From d2a62b07f02a83e648304979f4f61f769c17397b Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Wed, 26 May 2010 10:08:29 +0200 Subject: [PATCH] Create bindings for anonymous typedefs. --- src/libs/cplusplus/LookupContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 77880ca06cd..5f883feab9d 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -755,7 +755,7 @@ bool CreateBindings::visit(Enum *e) bool CreateBindings::visit(Declaration *decl) { if (decl->isTypedef()) { - const FullySpecifiedType ty = decl->type(); + FullySpecifiedType ty = decl->type(); const Identifier *typedefId = decl->identifier(); if (typedefId && ! (ty.isConst() || ty.isVolatile())) { @@ -766,6 +766,11 @@ bool CreateBindings::visit(Declaration *decl) Overview oo; qDebug() << "found entity not found for" << oo(namedTy->name()); } + } else if (Class *klass = ty->asClassType()) { + if (const NameId *nameId = decl->name()->asNameId()) { + ClassOrNamespace *binding = _currentClassOrNamespace->findOrCreateType(nameId); + binding->addSymbol(klass); + } } } } -- GitLab