diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 2a4357724..847d0b578 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -866,7 +866,7 @@ static Token * createAstAtToken(Token *tok, bool cpp) if (Token::Match(tok, "%type% <") && Token::Match(tok->linkAt(1), "> !!(")) return tok->linkAt(1); - if (tok->str() == "return" || !tok->previous() || Token::Match(tok, "%var% %op%|(|[|.|::") || Token::Match(tok->previous(), "[;{}] %cop%|( !!{")) { + if (tok->str() == "return" || !tok->previous() || Token::Match(tok, "%var% %op%|(|[|.|::") || Token::Match(tok->previous(), "[;{}] %cop%|++|--|( !!{")) { Token * const tok1 = tok; AST_state state(cpp); compileExpression(tok, state); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 2fc48a195..f13dceeb0 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -10649,6 +10649,7 @@ private: // how is "--" handled here: ASSERT_EQUALS("ab4<