[llvm-branch-commits] [cfe-branch] r118539 - in /cfe/branches/Apple/whitney: lib/Parse/ParseObjc.cpp test/Parser/missing-end-2.m
Daniel Dunbar
daniel at zuster.org
Tue Nov 9 09:30:32 PST 2010
Author: ddunbar
Date: Tue Nov 9 11:30:32 2010
New Revision: 118539
URL: http://llvm.org/viewvc/llvm-project?rev=118539&view=rev
Log:
Merge r117991:
--
Author: Fariborz Jahanian <fjahanian at apple.com>
Date: Tue Nov 2 00:44:43 2010 +0000
Diagnose a coherant message when @interface
does not terminate with @end.
// rdar: //7824372
Added:
cfe/branches/Apple/whitney/test/Parser/missing-end-2.m
Modified:
cfe/branches/Apple/whitney/lib/Parse/ParseObjc.cpp
Modified: cfe/branches/Apple/whitney/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Parse/ParseObjc.cpp?rev=118539&r1=118538&r2=118539&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseObjc.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseObjc.cpp Tue Nov 9 11:30:32 2010
@@ -402,7 +402,12 @@
// Skip until we see an '@' or '}' or ';'.
SkipUntil(tok::r_brace, tok::at);
break;
-
+
+ case tok::objc_implementation:
+ Diag(Tok, diag::err_objc_missing_end);
+ ConsumeToken();
+ break;
+
case tok::objc_required:
case tok::objc_optional:
// This is only valid on protocols.
Added: cfe/branches/Apple/whitney/test/Parser/missing-end-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Parser/missing-end-2.m?rev=118539&view=auto
==============================================================================
--- cfe/branches/Apple/whitney/test/Parser/missing-end-2.m (added)
+++ cfe/branches/Apple/whitney/test/Parser/missing-end-2.m Tue Nov 9 11:30:32 2010
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// rdar: //7824372
+
+ at interface A
+-(void) im0;
+
+ at implementation A // expected-error {{missing @end}}
+ at end
+
+ at interface B {
+}
+
+ at implementation B // expected-error {{missing @end}}
+ at end
+
+ at interface C
+ at property int P;
+
+ at implementation C // expected-error 2 {{missing @end}}
More information about the llvm-branch-commits
mailing list