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

c++: fix ICE with __type_pack_element [PR113834]

Here we crash on this invalid code because we seem to infinitely recurse
and end up with __type_pack_element with index that doesn't tree_fits_shwi_p
which then crashes on tree_to_shwi.

Thanks to Jakub for suggesting a nicer fix than my original one.

	PR c++/113834

gcc/cp/ChangeLog:

	* semantics.cc (finish_type_pack_element): Perform range checking
	before tree_to_shwi.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/type_pack_element4.C: New test.
parent 3a3e0f1b
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