Catch goto's with a missing identifier, patch by Neil Booth.

llvm-svn: 40381
This commit is contained in:
Chris Lattner 2007-07-22 04:13:33 +00:00
parent 9c724c48ea
commit e34b2c298a
2 changed files with 10 additions and 0 deletions

View File

@ -680,7 +680,11 @@ Parser::StmtResult Parser::ParseGotoStatement() {
return true;
}
Res = Actions.ParseIndirectGotoStmt(GotoLoc, StarLoc, R.Val);
} else {
Diag(Tok, diag::err_expected_ident);
return true;
}
return Res;
}

View File

@ -0,0 +1,6 @@
/* RUN: clang -parse-ast-check %s
*/
void foo() {
goto ; /* expected-error {{expected identifier}} */
}