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

llvm-svn: 169688
This commit is contained in:
Richard Smith 2012-12-09 04:17:57 +00:00
parent 95de7c37e2
commit c88e40450d
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(