[cfe-commits] r44870 - in /cfe/trunk: Parse/ParseObjc.cpp test/Parser/enhanced-proto-1.m
Fariborz Jahanian
fjahanian at apple.com
Tue Dec 11 10:34:52 PST 2007
Author: fjahanian
Date: Tue Dec 11 12:34:51 2007
New Revision: 44870
URL: http://llvm.org/viewvc/llvm-project?rev=44870&view=rev
Log:
Fixed a parsing bug whereby @optional/@required keyword is not followed by
a method declaration.
Added:
cfe/trunk/test/Parser/enhanced-proto-1.m
Modified:
cfe/trunk/Parse/ParseObjc.cpp
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=44870&r1=44869&r2=44870&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Tue Dec 11 12:34:51 2007
@@ -264,6 +264,9 @@
ExpectAndConsume(tok::semi, diag::err_expected_semi_after,"method proto");
continue;
}
+ else if (Tok.is(tok::at))
+ continue;
+
if (Tok.is(tok::semi))
ConsumeToken();
else if (Tok.is(tok::eof))
Added: cfe/trunk/test/Parser/enhanced-proto-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/enhanced-proto-1.m?rev=44870&view=auto
==============================================================================
--- cfe/trunk/test/Parser/enhanced-proto-1.m (added)
+++ cfe/trunk/test/Parser/enhanced-proto-1.m Tue Dec 11 12:34:51 2007
@@ -0,0 +1,17 @@
+// RUN: clang -fsyntax-only -verify %s
+
+ at protocol MyProto1
+ at optional
+- (void) FOO;
+ at optional
+- (void) FOO;
+ at required
+- (void) REQ;
+ at optional
+ at end
+
+ at protocol MyProto2 <MyProto1>
+- (void) FOO2;
+ at optional
+- (void) FOO3;
+ at end
More information about the cfe-commits
mailing list