C++: Fix endless loop in lookup on Windows

...for templates with typedefs referencing the respectively other
template (basic_ostream <-> ostreambuf_iterator).

Tested with MSVC 2013.

Regression introduced by ba42ceb0cb.

Task-number: QTCREATORBUG-13064
Task-number: QTCREATORBUG-13065
Change-Id: I71a45c720663a73c3302eb7da731e6ad2d8f0fbd
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-09-24 10:18:31 +02:00
parent c9f309f9be
commit 4da91bef8d
2 changed files with 50 additions and 1 deletions

View File

@@ -92,7 +92,10 @@ static bool isNestedInstantiationEnclosingTemplate(
ClassOrNamespace *nestedClassOrNamespaceInstantiation,
ClassOrNamespace *enclosingTemplateClassInstantiation)
{
while (enclosingTemplateClassInstantiation) {
QList<ClassOrNamespace *> processed;
while (enclosingTemplateClassInstantiation
&& !processed.contains(enclosingTemplateClassInstantiation)) {
processed.append(enclosingTemplateClassInstantiation);
if (enclosingTemplateClassInstantiation == nestedClassOrNamespaceInstantiation)
return false;
enclosingTemplateClassInstantiation = enclosingTemplateClassInstantiation->parent();