Compiling an invalid constexpr with gcc-15 cause an ICE message to be shown together with the correct message: Invalid code: constexpr int myconst = 2 * 2.5; compiled with: gcc-15 -O2 -pipe -Wall --std=gnu23 -o test test.c test.c:1:25: error: ‘constexpr’ integer initializer is not an integer constant expression 1 | constexpr int myconst = 2 * 2.5; | ^ test.c:1:1: internal compiler error: tree check: expected integer_cst, have real_cst in get_len, at tree.h:6509 1 | constexpr int myconst = 2 * 2.5; | ^~~~~~~~~ 0x5619670dad94 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x5619670db75d internal_error(char const*, ...) ???:0 0x5619652f27e2 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ???:0 0x561965f52d96 int_fits_type_p(tree_node const*, tree_node const*) ???:0 0x56196543da3f store_init_value(unsigned int, tree_node*, tree_node*, tree_node*) ???:0 0x56196540c7fb finish_decl(tree_node*, unsigned int, tree_node*, tree_node*, tree_node*) ???:0 0x561965498be7 c_parse_file() ???:0 0x56196550f9b0 c_common_parse_file() ???:0 gcc-14 (14.2.1_p20240921 p1) also is a bit weird about the same: gcc -O2 -pipe -Wall --std=gnu23 -o test test.c test.c:1:25: error: ‘constexpr’ integer initializer is not an integer constant expression 1 | constexpr int myconst = 2 * 2.5; | ^ test.c:1: confused by earlier errors, bailing out The first message is actually correct - the line is not valid, and was used during playing with the limits of constexpr.
Thanks, reported the ICE upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117139. Note that it happens with 14 and 13 with c2x, it's just that it's a checking ICE.