Fix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed

decltype expression.

llvm-svn: 151515
This commit is contained in:
Richard Smith 2012-02-27 05:24:00 +00:00
parent 317640dfd0
commit fa933d1225
2 changed files with 4 additions and 4 deletions

View File

@ -674,9 +674,9 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
0, /*IsDecltype=*/true);
Result = ParseExpression();
if (Result.isInvalid()) {
SkipUntil(tok::r_paren, true, true);
SkipUntil(tok::r_paren);
DS.SetTypeSpecError();
return Tok.is(tok::eof) ? Tok.getLocation() : ConsumeParen();
return StartLoc;
}
// Match the ')'

View File

@ -1,6 +1,6 @@
// RUN: not %clang_cc1 -fsyntax-only %s
// RUN: not %clang_cc1 -fsyntax-only -std=c++11 %s
// PR7481
decltype(;
struct{
a
}