aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-07-21 18:35:17 +0000
committerChris Lattner <sabre@nondot.org>2008-07-21 18:35:17 +0000
commit964c27c66c18f373fc91a60e9bf2c3d7c61522d1 (patch)
treed30062e711f0ea7e8c9382824e81977fc9e3e2f8 /lib/Sema/SemaDeclObjC.cpp
parent919d87d4eef4126ad6d7da1762c247ab0b5ca05b (diff)
add forward definition protocols to the protocol list for a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 6880eec9af..c3c2426bdc 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -137,11 +137,12 @@ Sema::DeclTy *Sema::ActOnStartClassInterface(
if (!RefPDecl)
Diag(EndProtoLoc, diag::err_undef_protocolref,
ProtocolNames[i]->getName(), ClassName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(EndProtoLoc, diag::warn_undef_protocolref,
- ProtocolNames[i]->getName(), ClassName->getName());
- else
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(EndProtoLoc, diag::warn_undef_protocolref,
+ ProtocolNames[i]->getName(), ClassName->getName());
RefProtos.push_back(RefPDecl);
+ }
}
if (!RefProtos.empty())
IDecl->addReferencedProtocols(&RefProtos[0], RefProtos.size());
@@ -223,11 +224,12 @@ Sema::DeclTy *Sema::ActOnStartProtocolInterface(
if (!RefPDecl)
Diag(ProtocolLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), ProtocolName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(ProtocolLoc, diag::warn_undef_protocolref,
- ProtoRefNames[i]->getName(), ProtocolName->getName());
-
- PDecl->setReferencedProtocols(i, RefPDecl);
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(ProtocolLoc, diag::warn_undef_protocolref,
+ ProtoRefNames[i]->getName(), ProtocolName->getName());
+ PDecl->setReferencedProtocols(i, RefPDecl);
+ }
}
PDecl->setLocEnd(EndProtoLoc);
}
@@ -434,11 +436,12 @@ Sema::DeclTy *Sema::ActOnStartCategoryInterface(
if (!RefPDecl)
Diag(CategoryLoc, diag::err_undef_protocolref,
ProtoRefNames[i]->getName(), CategoryName->getName());
- else if (RefPDecl->isForwardDecl())
- Diag(CategoryLoc, diag::warn_undef_protocolref,
- ProtoRefNames[i]->getName(), CategoryName->getName());
- if (RefPDecl)
+ else {
+ if (RefPDecl->isForwardDecl())
+ Diag(CategoryLoc, diag::warn_undef_protocolref,
+ ProtoRefNames[i]->getName(), CategoryName->getName());
RefProtocols.push_back(RefPDecl);
+ }
}
if (!RefProtocols.empty())
CDecl->addReferencedProtocols(&RefProtocols[0], RefProtocols.size());