Use 'override/final' instead of 'virtual' for overridden methods
[oota-llvm.git] / utils / unittest / googletest / src / gtest-death-test.cc
index b9693d3a0512004188970ee479c94d311ce67c2f..47c1a15b820cd3c43e98eb4a67363a8585a508e6 100644 (file)
@@ -300,6 +300,7 @@ DeathTest::DeathTest() {
   }
 }
 
+// Pin the vtable to this file.
 DeathTest::~DeathTest() {}
 
 // Creates and returns a death test by dispatching to the current
@@ -333,10 +334,10 @@ class DeathTestImpl : public DeathTest {
         write_fd_(-1) {}
 
   // read_fd_ is expected to be closed and cleared by a derived class.
-  ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
+  ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
 
-  void Abort(AbortReason reason);
-  virtual bool Passed(bool status_ok);
+  void Abort(AbortReason reason) override;
+  bool Passed(bool status_ok) override;
 
   const char* statement() const { return statement_; }
   const RE* regex() const { return regex_; }
@@ -743,7 +744,7 @@ class ForkingDeathTest : public DeathTestImpl {
   ForkingDeathTest(const char* statement, const RE* regex);
 
   // All of these virtual functions are inherited from DeathTest.
-  virtual int Wait();
+  int Wait() override;
 
  protected:
   void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
@@ -779,7 +780,7 @@ class NoExecDeathTest : public ForkingDeathTest {
  public:
   NoExecDeathTest(const char* a_statement, const RE* a_regex) :
       ForkingDeathTest(a_statement, a_regex) { }
-  virtual TestRole AssumeRole();
+  TestRole AssumeRole() override;
 };
 
 // The AssumeRole process for a fork-and-run death test.  It implements a
@@ -834,7 +835,8 @@ class ExecDeathTest : public ForkingDeathTest {
   ExecDeathTest(const char* a_statement, const RE* a_regex,
                 const char* file, int line) :
       ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
-  virtual TestRole AssumeRole();
+  TestRole AssumeRole() override;
+
  private:
   // The name of the file in which the death test is located.
   const char* const file_;
@@ -1037,8 +1039,6 @@ DeathTest::TestRole ExecDeathTest::AssumeRole() {
 
 # endif  // !GTEST_OS_WINDOWS
 
-DeathTestFactory::~DeathTestFactory() {}
-
 // Creates a concrete DeathTest-derived class that depends on the
 // --gtest_death_test_style flag, and sets the pointer pointed to
 // by the "test" argument to its address.  If the test should be
@@ -1095,6 +1095,9 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
   return true;
 }
 
+// Pin the vtable to this file.
+DeathTestFactory::~DeathTestFactory() {}
+
 // Splits a given string on a given delimiter, populating a given
 // vector with the fields.  GTEST_HAS_DEATH_TEST implies that we have
 // ::std::string, so we can use it here.