From d279f3fb41b0124f7b1dab98fb4a3d59567a844b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 27 Apr 2014 18:03:50 +0200 Subject: [PATCH] Fixed #5736 (AST: proper handling of 'a=(b).c;') --- lib/tokenlist.cpp | 2 +- test/testtokenize.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index e0de2e1ea..88dc33eb9 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -396,7 +396,7 @@ static bool iscast(const Token *tok) if (tok2->str() == ")") return tok2->previous()->str() == "*" || (Token::Match(tok2, ") %any%") && - (!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:]"))); + (!tok2->next()->isOp() && !Token::Match(tok2->next(), "[[]);,?:.]"))); if (!Token::Match(tok2, "%var%|*|&|::")) return false; } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 0ede51f2a..97d89c42a 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -10378,6 +10378,7 @@ private: testAst("x = ((a[i]).f)();", true)); ASSERT_EQUALS("abcde.++[.=", testAst("a = b.c[++(d.e)];")); ASSERT_EQUALS("abc(1+=", testAst("a = b(c**)+1;")); + ASSERT_EQUALS("abc.=", testAst("a = (b).c;")); // casts ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));