Skip to content
Snippets Groups Projects
Commit eb2ac188 authored by Christian Kamm's avatar Christian Kamm
Browse files

C++: Make 'follow symbol' for classes work in more cases.

Previously, it would still fail if a forward declaration and declaration
for a class were in the same file.

Task-number: QTCREATORBUG-20
parent 3c3af9c2
No related branches found
No related tags found
No related merge requests found
......@@ -807,11 +807,13 @@ Class *Snapshot::findMatchingClassDeclaration(Symbol *declaration) const
LookupContext context(doc, *this);
ClassOrNamespace *type = context.lookupType(declaration);
if (!type || type->symbols().count() != 1)
if (!type)
continue;
if (Class *c = type->symbols().first()->asClass())
return c;
foreach (Symbol *s, type->symbols()) {
if (Class *c = s->asClass())
return c;
}
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment