[cfe-commits] r100040 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/Parser/objc-messaging-neg-1.m
Fariborz Jahanian
fjahanian at apple.com
Wed Mar 31 13:22:35 PDT 2010
Author: fjahanian
Date: Wed Mar 31 15:22:35 2010
New Revision: 100040
URL: http://llvm.org/viewvc/llvm-project?rev=100040&view=rev
Log:
Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268).
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/test/Parser/objc-messaging-neg-1.m
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=100040&r1=100039&r2=100040&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Mar 31 15:22:35 2010
@@ -1817,9 +1817,12 @@
SkipUntil(tok::r_square);
return ExprError();
}
-
+
if (Tok.isNot(tok::r_square)) {
- Diag(Tok, diag::err_expected_rsquare);
+ if (Tok.is(tok::identifier))
+ Diag(Tok, diag::err_expected_colon);
+ else
+ Diag(Tok, diag::err_expected_rsquare);
// We must manually skip to a ']', otherwise the expression skipper will
// stop at the ']' when it skips to the ';'. We want it to skip beyond
// the enclosing expression.
Modified: cfe/trunk/test/Parser/objc-messaging-neg-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-messaging-neg-1.m?rev=100040&r1=100039&r2=100040&view=diff
==============================================================================
--- cfe/trunk/test/Parser/objc-messaging-neg-1.m (original)
+++ cfe/trunk/test/Parser/objc-messaging-neg-1.m Wed Mar 31 15:22:35 2010
@@ -1,6 +1,12 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+ at interface A
++(void) foo:(int) a;
+ at end
+
int main() {
id a;
[a bla:0 6:7]; // expected-error {{expected ']'}}
+ [A foo bar]; // expected-error {{expected ':'}}
+ [A foo bar bar1]; // expected-error {{expected ':'}}
}
More information about the cfe-commits
mailing list