Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268). llvm-svn: 100040
This commit is contained in:
parent
0208535fda
commit
083712fbb7
|
@ -1817,9 +1817,12 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
|
|||
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.
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
@interface A
|
||||
+(void) foo:(int) a;
|
||||
@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 ':'}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue