Fix FP in constVariable

This commit is contained in:
Daniel Marjamäki 2021-09-08 06:56:45 +02:00
parent 9ece849d80
commit 6f4ce486a2
2 changed files with 8 additions and 1 deletions

View File

@ -1903,7 +1903,7 @@ bool isVariableChangedByFunctionCall(const Token *tok, int indirect, const Setti
return false; // not a function => variable not changed
if (Token::simpleMatch(tok, "{") && isTrivialConstructor(tok))
return false;
if (tok->isKeyword() && !isCPPCastKeyword(tok))
if (tok->isKeyword() && !isCPPCastKeyword(tok) && tok->str().compare(0,8,"operator") != 0)
return false;
const Token * parenTok = tok->next();
if (Token::simpleMatch(parenTok, "<") && parenTok->link())

View File

@ -1801,6 +1801,13 @@ private:
check(code, &s64);
ASSERT_EQUALS("", errout.str());
}
check("Writer* getWriter();\n"
"\n"
"void foo(Buffer& buffer) {\n"
" getWriter()->operator<<(buffer);\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void passedByValue_externC() {