diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index cf3b70535..209563ed0 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -626,6 +626,9 @@ bool TemplateSimplifier::getTemplateDeclarations() } if (!Token::simpleMatch(tok, "template <")) continue; + // ignore template template parameter + if (tok->strAt(-1) == "<") + continue; // Some syntax checks, see #6865 if (!tok->tokAt(2)) syntaxError(tok->next()); diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 3fc841a5f..e92517ff8 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -142,6 +142,7 @@ private: TEST_CASE(template102); // #9005 TEST_CASE(template103); TEST_CASE(template104); // #9021 + TEST_CASE(template105); // #9076 TEST_CASE(template_specialization_1); // #7868 - template specialization template struct S> {..}; TEST_CASE(template_specialization_2); // #7868 - template specialization template struct S> {..}; TEST_CASE(template_enum); // #6299 Syntax error in complex enum declaration (including template) @@ -2384,6 +2385,19 @@ private: ASSERT_EQUALS(exp, tok(code)); } + void template105() { // #9076 + const char code[] = "template