diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 1bebcc605..d3b7cac76 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1252,7 +1252,7 @@ private: return vartok->next(); } - if (Token::Match(tok.previous(), "[;{}] %var% (")) + if (Token::Match(&tok, "%var% (")) { // parse usage.. std::list var; diff --git a/test/testother.cpp b/test/testother.cpp index 554ecfe6d..f86abb7d6 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -1216,7 +1216,7 @@ private: " FILE *f;\n" " fflush(f);\n" "}\n"); - ASSERT_EQUALS("error", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (error) Uninitialized variable: f\n", errout.str()); // arrays.. checkUninitVar("void f()\n"