]> granicus.if.org Git - clang/commitdiff
objc: allow class name qualified with protocols in
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Oct 2011 23:13:50 +0000 (23:13 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Oct 2011 23:13:50 +0000 (23:13 +0000)
iboutletcollection attribute. But ignore protocol
list. // rdar://10296078

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp
test/SemaObjC/iboutletcollection-attr.m

index 0c60e287414eaf964456e82977e8250eabe194ac..8cf25b619d60a948007c5cef690fff8859ccb57b 100644 (file)
@@ -248,7 +248,17 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
   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);
+      while (Tok.is(tok::identifier)) {
+        ConsumeToken();
+        if (Tok.is(tok::greater))
+          break;
+        if (Tok.is(tok::comma)) {
+          ConsumeToken();
+          continue;
+        }
+      }
+      if (Tok.isNot(tok::greater))
+        Diag(Tok, diag::err_iboutletcollection_with_protocol);
       SkipUntil(tok::r_paren, false, true); // skip until ')'
     }
   }
index 1491b3292d40d8545692fc554554f652a8b1fe41..7caebb059ea11d7d07b639064e2fdd4c5bebdca9 100644 (file)
@@ -39,5 +39,5 @@ typedef void *PV;
 
 @interface RDar10296078  : ParentRDar10296078
 @property (nonatomic, strong) 
-  __attribute__((iboutletcollection(RDar10296078_OtherClass<RDar10296078_Protocol>))) NSArray *stuff; // expected-error {{invalid argument of iboutletcollection attribute}}
+  __attribute__((iboutletcollection(RDar10296078_OtherClass<RDar10296078_Protocol>))) NSArray *stuff; 
 @end