https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115515
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Joseph Myers <js...@gcc.gnu.org>: https://gcc.gnu.org/g:5afc98fec97d84baa0c580809fb3e220444fa20d commit r15-5481-g5afc98fec97d84baa0c580809fb3e220444fa20d Author: Joseph Myers <josmy...@redhat.com> Date: Wed Nov 20 01:37:30 2024 +0000 c: Fix ICE for integer constexpr initializers of wrong type [PR115515] Bug 115515 (plus its duplicate 117139) reports an ICE with constexpr initializer for an integer type variable that is not of integer type. Fix this by not calling int_fits_type_p unless the previous check for an integer constant expression passes. Bootstrapped with no regressions for x86_64-pc-linux-gnu. PR c/115515 gcc/c/ * c-typeck.cc (check_constexpr_init): Do not call int_fits_type_p for arguments that are not integer constant expressions. gcc/testsuite/ * gcc.dg/c23-constexpr-10.c, gcc.dg/gnu23-constexpr-2.c: New tests.