c++: fix PR104025 change

Somehow I pushed my earlier patch without it actually fixing the test; we
need input_location to be for the last consumed token, not the next one.

gcc/cp/ChangeLog:

	* parser.cc (saved_token_sentinel::rollback): Use
	cp_lexer_previous_token.
This commit is contained in:
Jason Merrill 2022-01-18 22:11:56 -05:00
parent ddce00dba2
commit bd0ef35348

View File

@ -1308,7 +1308,8 @@ struct saved_token_sentinel
void rollback ()
{
cp_lexer_rollback_tokens (lexer);
cp_lexer_set_source_position (lexer);
cp_lexer_set_source_position_from_token
(cp_lexer_previous_token (lexer));
mode = STS_DONOTHING;
}
~saved_token_sentinel ()