PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Smith 2012-12-09 04:17:57 +00:00
parent 0f584640dc
commit 569cdc82c1
2 changed files with 4 additions and 2 deletions

View File

@ -707,8 +707,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) {
EndLoc = ConsumeParen();
} else {
assert(Tok.is(tok::semi));
if (PP.isBacktrackEnabled()) {
if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) {
// Backtrack to get the location of the last token before the semi.
PP.RevertCachedTokens(2);
ConsumeToken(); // the semi.

View File

@ -4,3 +4,6 @@ decltype(;
struct{
a
}
// PR14549. Must be at end of file.
decltype(