Add many missing override keywords

This helps corrects builds with -Werror=suggest-overrides
This commit is contained in:
Peter Barker 2019-08-16 09:40:45 +10:00
parent f2fb48c3b3
commit 2460f97152
4 changed files with 7 additions and 7 deletions

View File

@ -474,13 +474,13 @@ class PolymorphicMatcher {
public:
explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
virtual void DescribeTo(::std::ostream* os) const { impl_.DescribeTo(os); }
void DescribeTo(::std::ostream* os) const override { impl_.DescribeTo(os); }
virtual void DescribeNegationTo(::std::ostream* os) const {
void DescribeNegationTo(::std::ostream* os) const override {
impl_.DescribeNegationTo(os);
}
virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
bool MatchAndExplain(T x, MatchResultListener* listener) const override {
return impl_.MatchAndExplain(x, listener);
}

View File

@ -416,7 +416,7 @@ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
: public test_suite_name { \
public: \
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
virtual void TestBody(); \
void TestBody() override; \
\
private: \
static int AddToRegistry() { \

View File

@ -1354,7 +1354,7 @@ constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; }
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
\
private: \
virtual void TestBody(); \
void TestBody() override; \
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)); \

View File

@ -1808,7 +1808,7 @@ class GTEST_API_ ThreadLocal {
class DefaultValueHolderFactory : public ValueHolderFactory {
public:
DefaultValueHolderFactory() {}
virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
ValueHolder* MakeNewHolder() const override { return new ValueHolder(); }
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
@ -1817,7 +1817,7 @@ class GTEST_API_ ThreadLocal {
class InstanceValueHolderFactory : public ValueHolderFactory {
public:
explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
virtual ValueHolder* MakeNewHolder() const {
ValueHolder* MakeNewHolder() const override {
return new ValueHolder(value_);
}