forked from OSchip/llvm-project
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:
parent
317640dfd0
commit
fa933d1225
|
@ -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 ')'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue