aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-18 17:11:10 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-18 17:11:10 +0000
commit7a81e41a5e92dad2dd2a4edf27960c5d7f9c8063 (patch)
tree3ff696d1f7b5ff27a466251e1c9b23f8a0eff1de /lib
parent46d1ea40d77aa66527cc48183750710b55d74914 (diff)
objc: diagnose invalid argument to an
iboutletcollection attribute intead of crashing. // rdar://10296078 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Parse/ParseDecl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 3f4f4f8375..0c60e28741 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -245,6 +245,13 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
ConsumeToken(); // Eat the comma, move to the next argument
}
}
+ else if (Tok.is(tok::less) && AttrName->isStr("iboutletcollection")) {
+ if (!ExpectAndConsume(tok::less, diag::err_expected_less_after, "<",
+ tok::greater)) {
+ Diag(Tok, diag::err_iboutletcollection_with_protocol);
+ SkipUntil(tok::r_paren, false, true); // skip until ')'
+ }
+ }
SourceLocation RParen = Tok.getLocation();
if (!ExpectAndConsume(tok::r_paren, diag::err_expected_rparen)) {