diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 5ab9e55fd..df6a5614f 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -596,8 +596,11 @@ static void compileMulDiv(Token *&tok, std::stack &op, unsigned int dept compileDot(tok,op, depth); while (tok) { if (Token::Match(tok, "[*/%]")) { - if (Token::Match(tok, "* [,)]")) + if (Token::Match(tok, "* [*,)]")) { + while (tok->next() && tok->str() == "*") + tok = tok->next(); break; + } compileBinOp(tok, compileDot, op, depth); } else break; } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 589685c6a..217abb5cb 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -10345,6 +10345,7 @@ private: " `-f\n", testAst("x = ((a[i]).f)();", true)); ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];")); + ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;")); // casts ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));