From 7107286be676f97d1e9f61b766c570cb572bab5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 16 Oct 2014 15:57:05 +0200 Subject: [PATCH] Fixed #5891 (AST: wrong ast generated for 'x = (int)(double(123)*i);') --- 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 109fb0a57..cf265e01f 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -453,7 +453,7 @@ static bool iscast(const Token *tok) if (!Token::Match(tok2, "%var%|*|&|::")) return false; - if (tok2->isStandardType()) + if (tok2->isStandardType() && tok2->next()->str() != "(") type = true; } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 0f3cde7b1..31fb852b5 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8547,6 +8547,7 @@ private: ASSERT_EQUALS("afoveon_avgimage((foveon_avgimage((+=", testAst("a = foveon_avg(((short(*)[4]) image)) + foveon_avg(((short(*)[4]) image));")); ASSERT_EQUALS("c(40<