https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113834
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- To fix the ICE we could do: --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -4644,7 +4644,9 @@ static tree finish_type_pack_element (tree idx, tree types, tsubst_flags_t complain) { idx = maybe_constant_value (idx); - if (TREE_CODE (idx) != INTEGER_CST || !INTEGRAL_TYPE_P (TREE_TYPE (idx))) + if (TREE_CODE (idx) != INTEGER_CST + || !INTEGRAL_TYPE_P (TREE_TYPE (idx)) + || !tree_fits_shwi_p (idx)) { if (complain & tf_error) error ("%<__type_pack_element%> index is not an integral constant");