https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115476
Bug ID: 115476 Summary: __has_unique_object_representation ICE with array of uninstantiated type of unknown bound Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mital at mitalashok dot co.uk Target Milestone: --- Discovered when libc++ removed the `remove_extent_t` from the standard type trait: https://github.com/llvm/llvm-project/issues/95311 / https://github.com/llvm/llvm-project/pull/69241 https://gcc.godbolt.org/z/e136MGrG1 template <int> class Foo { int x; }; static_assert(__has_unique_object_representations(Foo<0>[])); With this error: ./test.cpp:6:59: internal compiler error: Segmentation fault 6 | static_assert(__has_unique_object_representations(Foo<0>[])); | ^ 0x13b4fb3 crash_signal ../../gcc/gcc/toplev.cc:319 0x7fb3eb34451f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0xd16bb0 contains_struct_check(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.h:4065 0xd16bb0 wi::extended_tree<128>::extended_tree(tree_node const*) ../../gcc/gcc/tree.h:6477 0xd16bb0 generic_wide_int<wi::extended_tree<128> >::generic_wide_int<tree_node const*>(tree_node const* const&) ../../gcc/gcc/wide-int.h:847 0xd16bb0 wi::to_offset(tree_node const*) ../../gcc/gcc/tree.h:6429 0xd16bb0 record_has_unique_obj_representations ../../gcc/gcc/cp/tree.cc:4836 0xd165a0 type_has_unique_obj_representations(tree_node const*) ../../gcc/gcc/cp/tree.cc:4751 0xcf620d finish_trait_expr(unsigned int, cp_trait_kind, tree_node*, tree_node*) ../../gcc/gcc/cp/semantics.cc:13088 0xc59ee7 cp_parser_trait ../../gcc/gcc/cp/parser.cc:11314 0xc4bba9 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.cc:7954 0xc244cf cp_parser_binary_expression ../../gcc/gcc/cp/parser.cc:10413 0xc25492 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.cc:10757 0xc2754d cp_parser_constant_expression ../../gcc/gcc/cp/parser.cc:11047 0xc29fce cp_parser_static_assert ../../gcc/gcc/cp/parser.cc:17105 0xc6f2d4 cp_parser_declaration ../../gcc/gcc/cp/parser.cc:15715 0xc6fdda cp_parser_toplevel_declaration ../../gcc/gcc/cp/parser.cc:15736 0xc6fdda cp_parser_translation_unit ../../gcc/gcc/cp/parser.cc:5299 0xc6fdda c_parse_file() ../../gcc/gcc/cp/parser.cc:51933 0xdc6629 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.cc:1322