https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118775
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:aa55a6a30bc4778938af42dac9b624cf67fa4698 commit r15-7893-gaa55a6a30bc4778938af42dac9b624cf67fa4698 Author: Marek Polacek <pola...@redhat.com> Date: Tue Feb 11 15:43:40 2025 -0500 c++: ICE with operator new[] in constexpr [PR118775] Here we ICE since r11-7740 because we no longer say that (long)&a (where a is a global var) is non_constant_p. So VERIFY_CONSTANT does not return and we crash on tree_to_uhwi. We should check tree_fits_uhwi_p before calling tree_to_uhwi. PR c++/118775 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_call_expression): Check tree_fits_uhwi_p. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/constexpr-new24.C: New test. * g++.dg/cpp2a/constexpr-new25.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com>