Fixed #4767 (segmentation fault in expand template)
This commit is contained in:
parent
287782a679
commit
42068a3d60
|
@ -630,7 +630,7 @@ void TemplateSimplifier::expandTemplate(
|
|||
std::list<Token *> &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..
|
||||
|
|
|
@ -1894,6 +1894,7 @@ private:
|
|||
"{\n"
|
||||
"public:\n"
|
||||
" static AA<T> create(T* newObject);\n"
|
||||
" static int size();\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"class CC { public: CC(AA<BB>, int) {} };\n"
|
||||
|
@ -1906,7 +1907,9 @@ private:
|
|||
"\n"
|
||||
"XX::XX():\n"
|
||||
" y(AA<CC>::create(new CC(AA<BB>(), 0)))\n"
|
||||
" {}\n";
|
||||
" {}\n"
|
||||
"\n"
|
||||
"int yy[AA<CC>::size()];";
|
||||
|
||||
// Just run it and check that there are not assertions.
|
||||
tok(code);
|
||||
|
|
Loading…
Reference in New Issue