Fixed #9373 (False Positive - missingOverride)

This commit is contained in:
Daniel Marjamäki 2019-11-03 18:42:04 +01:00
parent c3ae028a41
commit c7a23f126f
2 changed files with 11 additions and 2 deletions

View File

@ -2121,7 +2121,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se
// definition missing variable name
else if ((first->next()->str() == "," && second->next()->str() != ",") ||
(first->next()->str() == ")" && second->next()->str() != ")")) {
(Token::Match(first, "!!( )") && second->next()->str() != ")")) {
second = second->next();
// skip default value assignment
if (second->next()->str() == "=") {
@ -2134,7 +2134,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se
// function missing variable name
else if ((second->next()->str() == "," && first->next()->str() != ",") ||
(second->next()->str() == ")" && first->next()->str() != ")")) {
(Token::Match(second, "!!( )") && first->next()->str() != ")")) {
first = first->next();
// skip default value assignment
if (first->next()->str() == "=") {

View File

@ -7152,6 +7152,15 @@ private:
"};");
ASSERT_EQUALS("[test.cpp:4] -> [test.cpp:9]: (style) The destructor '~C' overrides a destructor in a base class but is not marked with a 'override' specifier.\n", errout.str());
checkOverride("struct Base {\n"
" virtual void foo();\n"
"};\n"
"\n"
"struct Derived: public Base {\n"
" void foo() override;\n"
" void foo(int);\n"
"};");
ASSERT_EQUALS("", errout.str());
}
void overrideCVRefQualifiers() {