Fixed #7095 (False positive: (warning) Return value of function to_string() is not used.)
This commit is contained in:
parent
7c800d6ed7
commit
774a8979a3
|
@ -157,7 +157,7 @@ void CheckFunctions::checkIgnoredReturnValue()
|
|||
const Scope * scope = symbolDatabase->functionScopes[i];
|
||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||
// c++11 initialization
|
||||
if (Token::Match(tok, "%var% {"))
|
||||
if (Token::Match(tok, "%var% (| {"))
|
||||
tok = tok->linkAt(1);
|
||||
|
||||
if (tok->varId() || !Token::Match(tok, "%name% (") || tok->strAt(-1) == ".")
|
||||
|
|
|
@ -894,13 +894,18 @@ private:
|
|||
" void * res{malloc(size)};\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
|
||||
// #7447
|
||||
check("void foo() {\n"
|
||||
" int x{mystrcmp(a,b)};\n"
|
||||
"}", "test.cpp", &settings2);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
|
||||
// #7905
|
||||
check("void foo() {\n"
|
||||
" int x({mystrcmp(a,b)});\n"
|
||||
"}", "test.cpp", &settings2);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue