parent
49147f95fe
commit
81bcbfa7fe
|
@ -1754,7 +1754,8 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
|
|||
if (Token::Match(tok1, "%name%")) {
|
||||
if (tok1->str() == "return")
|
||||
return false;
|
||||
tok1 = tok1->previous();
|
||||
if (tok1->str() != "friend")
|
||||
tok1 = tok1->previous();
|
||||
}
|
||||
|
||||
// skip over qualification
|
||||
|
|
|
@ -7678,6 +7678,15 @@ private:
|
|||
" void f(char c, std::vector<int> w = {});\n"
|
||||
"};\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:5]: (style) The function 'f' overrides a function in a base class but is not marked with a 'override' specifier.\n", "", errout.str());
|
||||
|
||||
checkOverride("struct T {};\n" // #10920
|
||||
"struct B {\n"
|
||||
" virtual T f() = 0;\n"
|
||||
"};\n"
|
||||
"struct D : B {\n"
|
||||
" friend T f();\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void overrideCVRefQualifiers() {
|
||||
|
|
Loading…
Reference in New Issue