diff --git a/src/libs/cplusplus/CheckUndefinedSymbols.cpp b/src/libs/cplusplus/CheckUndefinedSymbols.cpp index ca43b1fb3d90fb01f2aa82e790f3c3d3594c2429..febb19e27230f631a01a09d6cbe0c2f85fcb0f72 100644 --- a/src/libs/cplusplus/CheckUndefinedSymbols.cpp +++ b/src/libs/cplusplus/CheckUndefinedSymbols.cpp @@ -135,18 +135,24 @@ void CheckUndefinedSymbols::buildTypeMap(Class *klass) addType(klass->name()); for (unsigned i = 0; i < klass->memberCount(); ++i) { - Symbol *member = klass->memberAt(i); - - if (Class *klass = member->asClass()) { - buildTypeMap(klass); - } else if (Enum *e = member->asEnum()) { - addType(e->name()); - } else if (ForwardClassDeclaration *fwd = member->asForwardClassDeclaration()) { - addType(fwd->name()); - } else if (Declaration *decl = member->asDeclaration()) { - if (decl->isTypedef()) - addType(decl->name()); - } + buildMemberTypeMap(klass->memberAt(i)); + } +} + +void CheckUndefinedSymbols::buildMemberTypeMap(Symbol *member) +{ + if (member == 0) + return; + + if (Class *klass = member->asClass()) { + buildTypeMap(klass); + } else if (Enum *e = member->asEnum()) { + addType(e->name()); + } else if (ForwardClassDeclaration *fwd = member->asForwardClassDeclaration()) { + addType(fwd->name()); + } else if (Declaration *decl = member->asDeclaration()) { + if (decl->isTypedef()) + addType(decl->name()); } } @@ -176,10 +182,16 @@ void CheckUndefinedSymbols::buildTypeMap(NamespaceBinding *binding, QSet<Namespa addType(fKlass->name()); } else if (ObjCClass *klass = member->asObjCClass()) { addType(klass->name()); + + for (unsigned i = 0; i < klass->memberCount(); ++i) + buildMemberTypeMap(klass->memberAt(i)); } else if (ObjCForwardProtocolDeclaration *fProto = member->asObjCForwardProtocolDeclaration()) { addType(fProto->name()); } else if (ObjCProtocol *proto = member->asObjCProtocol()) { addType(proto->name()); + + for (unsigned i = 0; i < proto->memberCount(); ++i) + buildMemberTypeMap(proto->memberAt(i)); } } } diff --git a/src/libs/cplusplus/CheckUndefinedSymbols.h b/src/libs/cplusplus/CheckUndefinedSymbols.h index 3108cda0e6f921dec63743db0c6453444d6e05e6..745ee50b11124942e2398f8913a6121e8f333ebf 100644 --- a/src/libs/cplusplus/CheckUndefinedSymbols.h +++ b/src/libs/cplusplus/CheckUndefinedSymbols.h @@ -57,6 +57,7 @@ protected: void addType(Name *name); void buildTypeMap(Class *klass); + void buildMemberTypeMap(Symbol *member); void buildTypeMap(NamespaceBinding *binding, QSet<NamespaceBinding *> *processed); FunctionDeclaratorAST *currentFunctionDeclarator() const;