aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erikjv@me.com>2011-12-08 09:58:43 +0000
committerErik Verbruggen <erikjv@me.com>2011-12-08 09:58:43 +0000
commit90ec96f3026480fa41057b05d58f338aed585f62 (patch)
tree116fb2fe24a84c6d8e9c25b9d991d4884e1c9bd7 /lib/Parse/ParseObjc.cpp
parentf4e8a12ea6f93843910e750b26bfc9d3ead1f078 (diff)
Fix: allow @protocol forward declarations inside @implementation-s.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 737f2b858d..5ac1d6c331 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1343,7 +1343,6 @@ Decl *Parser::ParseObjCAtProtocolDeclaration(SourceLocation AtLoc,
ParsedAttributes &attrs) {
assert(Tok.isObjCAtKeyword(tok::objc_protocol) &&
"ParseObjCAtProtocolDeclaration(): Expected @protocol");
- CheckNestedObjCContexts(AtLoc);
ConsumeToken(); // the "protocol" identifier
if (Tok.is(tok::code_completion)) {
@@ -1367,6 +1366,8 @@ Decl *Parser::ParseObjCAtProtocolDeclaration(SourceLocation AtLoc,
attrs.getList());
}
+ CheckNestedObjCContexts(AtLoc);
+
if (Tok.is(tok::comma)) { // list of forward declarations.
SmallVector<IdentifierLocPair, 8> ProtocolRefs;
ProtocolRefs.push_back(std::make_pair(protocolName, nameLoc));