TOK(eod) // End of preprocessing directive (end of line inside a
// directive).
TOK(code_completion) // Code completion marker
-TOK(cxx_exceptspec_end) // C++ exception-specification end marker
// C99 6.4.9: Comments.
TOK(comment) // Comment (only in -E -C[C] mode)
ExceptionSpecTokens);
// Clean up the remaining tokens.
- if (Tok.is(tok::cxx_exceptspec_end))
+ if (Tok.is(tok::eof) && Tok.getEofData() == Actions.CurScope)
ConsumeToken();
else if (EST != EST_None)
Diag(Tok.getLocation(), diag::err_except_spec_unparsed);
// There could be leftover tokens (e.g. because of an error).
// Skip through until we reach the original token position.
- while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof))
+ while (Tok.getLocation() != origLoc) {
+ if (Tok.is(tok::eof) && Tok.getEofData() != Actions.CurScope)
+ break;
ConsumeAnyToken();
+ }
delete Toks;
LM.ExceptionSpecTokens = nullptr;
// Add the 'stop' token.
Token End;
End.startToken();
- End.setKind(tok::cxx_exceptspec_end);
+ End.setKind(tok::eof);
End.setLocation(Tok.getLocation());
+ End.setEofData(Actions.CurScope);
ExceptionSpecTokens->push_back(End);
return EST_Unparsed;
}