diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 5f33baca5..884c96181 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -650,6 +650,9 @@ static bool isPrefixUnary(const Token* tok, bool cpp) && (tok->previous()->tokType() != Token::eIncDecOp || tok->tokType() == Token::eIncDecOp))) return true; + if (tok->str() == "*" && tok->previous()->tokType() == Token::eIncDecOp && isPrefixUnary(tok->previous(), cpp)) + return true; + return tok->strAt(-1) == ")" && iscast(tok->linkAt(-1)); } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 794cd4b50..213c1e355 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8466,6 +8466,7 @@ private: ASSERT_EQUALS("xreturn", testAst("return x;")); ASSERT_EQUALS("x(throw", testAst(";throw x();")); ASSERT_EQUALS("a*bc:?return", testAst("return *a ? b : c;")); + ASSERT_EQUALS("xy*--=", testAst("x = -- * y;")); // Unary :: operator ASSERT_EQUALS("abcd::12,(e/:?=", testAst("a = b ? c : ::d(1,2) / e;"));