Revert "Missing override specifier warning on a pure virtual function makes no sense. (#1230)"

This reverts commit 348eb1c5c9.
This commit is contained in:
Daniel Marjamäki 2018-05-15 10:48:34 +02:00 committed by Daniel Marjamäki
parent d0089fe305
commit f7746e4fb6
2 changed files with 1 additions and 15 deletions

View File

@ -2584,7 +2584,7 @@ void CheckClass::checkOverride()
if (func.hasOverrideSpecifier() || func.hasFinalSpecifier())
continue;
const Function *baseFunc = func.getOverridenFunction();
if (baseFunc && !baseFunc->isPure())
if (baseFunc)
overrideError(baseFunc, &func);
}
}

View File

@ -212,7 +212,6 @@ private:
TEST_CASE(unsafeClassDivZero);
TEST_CASE(override1);
TEST_CASE(override2);
}
void checkCopyCtorAndEqOperator(const char code[]) {
@ -6783,19 +6782,6 @@ private:
"class Derived : Base { virtual void f() final; };");
ASSERT_EQUALS("", errout.str());
}
void override2() {
checkOverride("class TimerResultsIntf {\n"
"public:\n"
" virtual void AddResults(const std::string& str, std::clock_t clocks) = 0;\n"
"};\n"
"class TimerResults : public TimerResultsIntf {\n"
"public:\n"
" virtual void AddResults(const std::string& str, std::clock_t clocks);\n"
"};");
ASSERT_EQUALS("", errout.str());
};
};
REGISTER_TEST(TestClass)