summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-07 19:21:03 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-07 19:21:03 +0000
commitc41cf0598f076f8f6cd2223c739592a91fe78717 (patch)
tree43bee48748627ae5dabf535eebcd4aeb068fde35 /clang/lib/Sema
parent68d31ce5ff33c987104431efa45c30cfe53df27f (diff)
downloadbcm5719-llvm-c41cf0598f076f8f6cd2223c739592a91fe78717.tar.gz
bcm5719-llvm-c41cf0598f076f8f6cd2223c739592a91fe78717.zip
objective-C: when searching for declarations in protocol
list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 64b000ee9ab..d22d7a14f60 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1593,6 +1593,11 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc,
NSIDecl = IDecl->lookupInheritedClass(&Context.Idents.get("NSProxy"));
}
+ // If this is a forward protocol declaration, get its definition.
+ if (!PDecl->isThisDeclarationADefinition() &&
+ PDecl->getDefinition())
+ PDecl = PDecl->getDefinition();
+
// If a method lookup fails locally we still need to look and see if
// the method was implemented by a base class or an inherited
// protocol. This lookup is slow, but occurs rarely in correct code
OpenPOWER on IntegriCloud