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
......@@ -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)
if (Class *c = type->symbols().first()->asClass())
return c;
foreach (Symbol *s, type->symbols()) {
if (Class *c = s->asClass())
return c;
return 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment