This commit is contained in:
parent
6020feb271
commit
4ebdf5fae1
|
@ -790,7 +790,7 @@ void CheckCondition::multiCondition2()
|
|||
if (!function || !function->isConst())
|
||||
break;
|
||||
}
|
||||
if (Token::Match(tok->previous(), "[(,] %name% [,)]") && isParameterChanged(tok))
|
||||
if (Token::Match(tok->previous(), "[(,] *|& %name% [,)]") && isParameterChanged(tok))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2887,6 +2887,23 @@ private:
|
|||
" return 0;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #11478
|
||||
check("struct S {\n"
|
||||
" void run();\n"
|
||||
" bool b = false;\n"
|
||||
" const std::function<void(S&)> f;\n"
|
||||
"};\n"
|
||||
"void S::run() {\n"
|
||||
" while (true) {\n"
|
||||
" if (b)\n"
|
||||
" return;\n"
|
||||
" f(*this);\n"
|
||||
" if (b)\n"
|
||||
" return;\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void innerConditionModified() {
|
||||
|
|
Loading…
Reference in New Issue