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:
parent
95de7c37e2
commit
c88e40450d
|
@ -707,8 +707,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
|
||||||
if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) {
|
if (SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true)) {
|
||||||
EndLoc = ConsumeParen();
|
EndLoc = ConsumeParen();
|
||||||
} else {
|
} else {
|
||||||
assert(Tok.is(tok::semi));
|
if (PP.isBacktrackEnabled() && Tok.is(tok::semi)) {
|
||||||
if (PP.isBacktrackEnabled()) {
|
|
||||||
// Backtrack to get the location of the last token before the semi.
|
// Backtrack to get the location of the last token before the semi.
|
||||||
PP.RevertCachedTokens(2);
|
PP.RevertCachedTokens(2);
|
||||||
ConsumeToken(); // the semi.
|
ConsumeToken(); // the semi.
|
||||||
|
|
|
@ -4,3 +4,6 @@ decltype(;
|
||||||
struct{
|
struct{
|
||||||
a
|
a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PR14549. Must be at end of file.
|
||||||
|
decltype(
|
||||||
|
|
Loading…
Reference in New Issue