Skip to content
Snippets Groups Projects
Commit 0999f260 authored by Marek Polacek's avatar Marek Polacek
Browse files

c++: Fix ICE-on-invalid with -Wvexing-parse [PR97881]

This invalid (?) code broke my assumption that if decl_specifiers->type
is null, there must be any type-specifiers.  Turn the assert into an if
to fix this crash.

gcc/cp/ChangeLog:

	PR c++/97881
	* parser.c (warn_about_ambiguous_parse): Only assume "int" if we
	actually saw any type-specifiers.

gcc/testsuite/ChangeLog:

	PR c++/97881
	* g++.dg/warn/Wvexing-parse9.C: New test.
parent 1cb50c0a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment