diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-07 19:21:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-07 19:21:03 +0000 |
commit | 32b94bedc6a789e4091626e7433e73555cf9df00 (patch) | |
tree | 1f7c6085f721fcfb9facdc66e45ab31337147ee0 /lib/AST/DeclObjC.cpp | |
parent | 3453bf7da9ac88cd2421b7fdccebf5cd2b8a9d87 (diff) |
objective-C: when searching for declarations in protocol
list of classes, etc., make sure to look into protocol
definitions. // rdar://12958878
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 12e5d8c304..62b4f5ea82 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -1352,15 +1352,19 @@ void ObjCProtocolDecl::startDefinition() { } void ObjCProtocolDecl::collectPropertiesToImplement(PropertyMap &PM) const { - for (ObjCProtocolDecl::prop_iterator P = prop_begin(), - E = prop_end(); P != E; ++P) { + const ObjCProtocolDecl *PDecl = this; + if (!isThisDeclarationADefinition() && getDefinition()) + PDecl = getDefinition(); + + for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(), + E = PDecl->prop_end(); P != E; ++P) { ObjCPropertyDecl *Prop = *P; // Insert into PM if not there already. PM.insert(std::make_pair(Prop->getIdentifier(), Prop)); } // Scan through protocol's protocols. - for (ObjCProtocolDecl::protocol_iterator PI = protocol_begin(), - E = protocol_end(); PI != E; ++PI) + for (ObjCProtocolDecl::protocol_iterator PI = PDecl->protocol_begin(), + E = PDecl->protocol_end(); PI != E; ++PI) (*PI)->collectPropertiesToImplement(PM); } |