Fix functionConst TODO (#5261)

This commit is contained in:
chrchr-github 2023-07-24 16:26:23 +02:00 committed by GitHub
parent 101ddea1e6
commit 2cf4b3a6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1107,7 +1107,7 @@ void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass)
continue;
bool isTemplateArg = false;
if (tok->next()->str() != "(") {
if (!Token::Match(tok->next(), "(|{")) {
const Token *start = tok;
while (Token::Match(start->tokAt(-2), "%name% ::"))
start = start->tokAt(-2);

View File

@ -6061,7 +6061,7 @@ private:
" int i{};\n"
" S f() { return S{ &i }; }\n"
"};\n");
TODO_ASSERT_EQUALS("[test.cpp:7]: (style, inconclusive) Technically the member function 'C::f' can be const.\n", "", errout.str());
ASSERT_EQUALS("[test.cpp:7]: (style, inconclusive) Technically the member function 'C::f' can be const.\n", errout.str());
checkConst("struct S {\n"
" explicit S(const int* p) : mp(p) {}\n"