TOK(eod) // End of preprocessing directive (end of line inside a
// directive).
TOK(code_completion) // Code completion marker
-TOK(cxx_defaultarg_end) // C++ default argument end marker
TOK(cxx_exceptspec_end) // C++ exception-specification end marker
// C99 6.4.9: Comments.
Actions.ActOnParamDefaultArgumentError(LM.DefaultArgs[I].Param,
EqualLoc);
else {
- if (!TryConsumeToken(tok::cxx_defaultarg_end)) {
+ if (Tok.is(tok::eof) && Tok.getEofData() == LM.DefaultArgs[I].Param) {
+ ConsumeAnyToken();
+ } else {
// The last two tokens are the terminator and the saved value of
// Tok; the last token in the default argument is the one before
// those.
"ParseAssignmentExpression went over the default arg tokens!");
// 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() != LM.DefaultArgs[I].Param)
+ break;
ConsumeAnyToken();
+ }
delete Toks;
LM.DefaultArgs[I].Toks = nullptr;
switch (Tok.getKind()) {
case tok::eof:
- case tok::cxx_defaultarg_end:
case tok::annot_module_begin:
case tok::annot_module_end:
case tok::annot_module_include:
// stop when we parse it later on.
Token DefArgEnd;
DefArgEnd.startToken();
- DefArgEnd.setKind(tok::cxx_defaultarg_end);
+ DefArgEnd.setKind(tok::eof);
DefArgEnd.setLocation(Tok.getLocation());
+ DefArgEnd.setEofData(Param);
DefArgToks->push_back(DefArgEnd);
Actions.ActOnParamUnparsedDefaultArgument(Param, EqualLoc,
(*DefArgToks)[1].getLocation());
// Ran out of tokens.
return false;
- case tok::cxx_defaultarg_end:
- // It's never desirable to consume the 'end-of-default-argument' token.
- return false;
-
case tok::annot_pragma_openmp_end:
// Stop before an OpenMP pragma boundary.
case tok::annot_module_begin: