forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user