forked from OSchip/llvm-project
Objective-C parsing [qoi]: Provide good recovery when
Objective-C dictionary literals has bad syntax for the separator. // rdar://10679157 llvm-svn: 179784
This commit is contained in:
parent
0c95efad7e
commit
507a5f8cb3
|
@ -2747,7 +2747,9 @@ ExprResult Parser::ParseObjCDictionaryLiteral(SourceLocation AtLoc) {
|
|||
if (Tok.is(tok::colon)) {
|
||||
ConsumeToken();
|
||||
} else {
|
||||
return ExprError(Diag(Tok, diag::err_expected_colon));
|
||||
Diag(Tok, diag::err_expected_colon);
|
||||
SkipUntil(tok::r_brace);
|
||||
return ExprError();
|
||||
}
|
||||
|
||||
ExprResult ValueExpr(ParseAssignmentExpression());
|
||||
|
|
|
@ -24,3 +24,11 @@ id missing_parentheses() {
|
|||
return @(5; // expected-error {{expected ')'}} \
|
||||
// expected-note {{to match this '('}}
|
||||
}
|
||||
|
||||
// rdar://10679157
|
||||
void bar(id p);
|
||||
void foo(id p) {
|
||||
bar(@{p, p}); // expected-error {{expected ':'}}
|
||||
bar(0);
|
||||
bar(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue