diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index fdcb0192b..8119cda3b 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1835,6 +1835,7 @@ bool Tokenizer::tokenizeCondition(const std::string &code) void Tokenizer::findComplicatedSyntaxErrorsInTemplates() { + validate(); TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(list.front()); } @@ -3495,7 +3496,7 @@ bool Tokenizer::simplifyTokenList1(const char FileName[]) // Remove __declspec() simplifyDeclspec(); - + validate(); // remove some unhandled macros in global scope removeMacrosInGlobalScope(); diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index cd6e4d759..d73a962d1 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -209,7 +209,7 @@ private: TEST_CASE(garbageCode158); // #3238 TEST_CASE(garbageCode159); // #7119 TEST_CASE(garbageCode160); // #7190 - + TEST_CASE(garbageCode161); // #7200 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageAST); @@ -1382,6 +1382,10 @@ private: // #4169 checkCode("volatile true , test < test < #ifdef __ppc__ true ,"); } + void garbageCode161() { + //7200 + ASSERT_THROW(checkCode("{ }{ if () try { } catch (...)} B : : ~B { }"), InternalError); + } }; REGISTER_TEST(TestGarbage)