Commit 97319559 authored by Leandro Melo's avatar Leandro Melo

C++: Fix crash in type hierarchy when anonymous in typedefs

Task-number: QTCREATORBUG-6445

Change-Id: If62745b58cad330c1f6a8605a444ec13644a1f20
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent c1523aa6
......@@ -101,9 +101,12 @@ bool DerivedHierarchyVisitor::visit(Class *symbol)
Symbol *actualBaseSymbol = items.first().declaration();
if (actualBaseSymbol->isTypedef()) {
NamedType *namedType = actualBaseSymbol->type()->asNamedType();
if (!namedType) {
// Anonymous aggregate such as: typedef struct {} Empty;
continue;
}
const QString &typeName = _overview.prettyName(namedType->name());
if (namedType &&
(typeName == _unqualifiedName || typeName == _qualifiedName)) {
if (typeName == _unqualifiedName || typeName == _qualifiedName) {
items = _context.lookup(namedType->name(), actualBaseSymbol->enclosingScope());
if (items.isEmpty() || !items.first().declaration())
continue;
......
Markdown is supported
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