diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index 96a150790..fd64af69b 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -630,7 +630,7 @@ void TemplateSimplifier::expandTemplate( std::list &templateInstantiations) { for (const Token *tok3 = tokenlist.front(); tok3; tok3 = tok3->next()) { - if (tok3->str() == "{" || tok3->str() == "(") + if (tok3->str() == "{" || tok3->str() == "(" || tok3->str() == "[") tok3 = tok3->link(); // Start of template.. diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index dcdee039d..a4efc7851 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -1894,6 +1894,7 @@ private: "{\n" "public:\n" " static AA create(T* newObject);\n" + " static int size();\n" "};\n" "\n" "class CC { public: CC(AA, int) {} };\n" @@ -1906,7 +1907,9 @@ private: "\n" "XX::XX():\n" " y(AA::create(new CC(AA(), 0)))\n" - " {}\n"; + " {}\n" + "\n" + "int yy[AA::size()];"; // Just run it and check that there are not assertions. tok(code);