From dc38681a5608815d06dbd16b24288bc1f7d82002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 22 Oct 2018 11:37:08 +0200 Subject: [PATCH] Remove FIXME in AST validation. Ticket #8749 --- lib/tokenlist.cpp | 3 --- test/testgarbage.cpp | 7 ------- test/testtokenize.cpp | 3 +++ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index a678c530d..97cfb6f99 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -1236,9 +1236,6 @@ void TokenList::validateAst() const // FIXME: Workaround broken AST assignment in type aliases if (Token::Match(tok->previous(), "%name% = %name%")) continue; - // FIXME: Workaround when assigning from a new expression: #8749 - if (Token::simpleMatch(tok, "= new")) - continue; if (!tok->astOperand1() || !tok->astOperand2()) throw InternalError(tok, "Syntax Error: AST broken, binary operator '" + tok->str() + "' doesn't have two operands.", InternalError::AST); } diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index ce63f0dc2..d79eb8ae6 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -1617,13 +1617,6 @@ private: "List::DeleteIf( const Predicate &pred )\n" "{}\n"); - // #8749 - checkCode( - "typedef char A[1];\n" - "void f(void) {\n" - " char (*p)[1] = new A[1];\n" - "}\n"); - // #8749 checkCode( "struct A {\n" diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 7924863ad..bd438aff5 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8259,6 +8259,9 @@ private: ASSERT_EQUALS("DerivedDerived::(", testAst("Derived::~Derived() {}")); ASSERT_EQUALS("ifCA_FarReadfilenew(,sizeofobjtype(,(!(", testAst("if (!CA_FarRead(file, (void far *)new, sizeof(objtype)))")); // #5910 - don't hang if C code is parsed as C++ + + // Variable declaration + ASSERT_EQUALS("charp*(3[char5[3[new=", testAst("char (*p)[3] = new char[5][3];")); } void astexpr2() { // limit for large expressions