aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-09 17:52:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-09 17:52:29 +0000
commit3c9a0240b6db6ee02a24f48c753089bda48843ae (patch)
treef5fbf9e2e997f8545a6ad316558cdc2e5e56cf48 /lib/Sema/SemaDeclObjC.cpp
parent5999f7634e80daf849a036aa830fc0e4b1e03555 (diff)
Objective-C: This patch fixes a none-issuance of warning
when result type of protocol property and getter method differ by fixing a more serious problem. When a forward protocol declaration comes between its definition and its use in class protocol list, the forward protocol ast was being used in building the protocol list. // rdar://12522752 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 5c26d7ff8e..cb5de9c84a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -745,7 +745,10 @@ Sema::FindProtocolDeclaration(bool WarnOnDeclarations,
<< ProtocolId[i].first;
continue;
}
-
+ // If this is a forward protocol declaration, get its definition.
+ if (!PDecl->isThisDeclarationADefinition() && PDecl->getDefinition())
+ PDecl = PDecl->getDefinition();
+
(void)DiagnoseUseOfDecl(PDecl, ProtocolId[i].second);
// If this is a forward declaration and we are supposed to warn in this