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/Sema/SemaDeclObjC.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/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 64b000ee9a..d22d7a14f6 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/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 |