https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121088
Bug ID: 121088 Summary: internal compiler error: Segmentation fault finish_static_data_member_decl since 12.1 Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mario.rodriguezb1 at um dot es Target Milestone: --- ICE maybe related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121085: Program: ``` template <class T> struct PointerMutator1 { template <class U> static auto TestMemberAccess(U*) -> decltype( (static_cast<T*>(0))->operator=(42) ); static const auto Value = decltype(TestMemberAccess<int>(0))::value; }; int main() { PointerMutator1<int>::Value } ``` Stack dump ``` <source>:10:65: internal compiler error: Segmentation fault 10 | static const auto Value = decltype(TestMemberAccess<int>(0))::value; | ~~~~~~~~~~~~~~~~~~~~~^~~ 0x2879ca5 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x289b986 internal_error(char const*, ...) ???:0 0xd556bd tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd782d9 instantiate_decl(tree_node*, bool, bool) ???:0 0xbf3387 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int, cp_decomp*) ???:0 0xc03be3 finish_static_data_member_decl(tree_node*, tree_node*, bool, tree_node*, int) ???:0 0xd845d8 instantiate_class_template(tree_node*) ???:0 0xd20193 c_parse_file() ???:0 0xe8a449 c_common_parse_file() ???:0 ``` To quickly reproduce: https://godbolt.org/z/rzq3Eqnrr