diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 39f38b4ed..34e0e4227 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1660,7 +1660,7 @@ private: else if (Token::simpleMatch(tok2, "sizeof (")) { - tok2 = tok2->link(); + tok2 = tok2->next()->link(); if (!tok2) break; } diff --git a/test/testother.cpp b/test/testother.cpp index da4383520..e4a9fb50f 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -1148,6 +1148,14 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); + checkUninitVar("void f()\n" + "{\n" + " int c;\n" + " ab(sizeof(xyz), &c);\n" + " if (c);\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); + // goto.. checkUninitVar("void foo(int x)\n" "{\n"