Fixed #3586 (false positive: uninitvar in argument in namespaced function)
This commit is contained in:
parent
b4d78e3d05
commit
84c0368bfd
|
@ -474,7 +474,7 @@ private:
|
|||
// variable is assigned like: "( %var% ) .. ="
|
||||
if (Token::Match(tok.previous(), "( %var% )") && tok2 && tok2->str() == "=")
|
||||
ExecutionPath::bailOutVar(checks, tok.varId());
|
||||
else
|
||||
else if (!(tok.strAt(-2) == ">" && tok.tokAt(-2)->link()))
|
||||
use(checks, &tok);
|
||||
//use_array(checks, &tok);
|
||||
return &tok;
|
||||
|
|
|
@ -1777,6 +1777,12 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void f() {\n" // #3586 - calling template function
|
||||
" int i;\n"
|
||||
" a::b<int>(i);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// using uninitialized function pointer..
|
||||
checkUninitVar("void foo()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue