https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104847
Bug ID: 104847 Summary: [11/12 Regression] ICE in write_unqualified_name, at cp/mangle.cc:1406 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started between 20200705 and 20200712 : $ cat z1.cc struct S { int i; }; union U { S k; }; template <class T, class... Ts> T sink(T&&, Ts&&...); template <class T> decltype(sink(U{1},T())) f(T) { return U{1}; } int main() { f(3); } $ g++-11-20200705 -c z1.cc $ $ g++-12-20220306 -c z1.cc z1.cc: In instantiation of 'decltype (sink(U{1}, T())) f(T) [with T = int]': z1.cc:5:26: internal compiler error: Segmentation fault 5 | decltype(sink(U{1},T())) f(T) { return U{1}; } | ^ 0xda3e3f crash_signal ../../gcc/toplev.cc:322 0x77dc08 write_unqualified_name ../../gcc/cp/mangle.cc:1406 0x783f89 write_expression ../../gcc/cp/mangle.cc:3370 0x782e96 write_expression ../../gcc/cp/mangle.cc:3507 0x77fb94 write_type ../../gcc/cp/mangle.cc:2372 0x7815f9 write_bare_function_type ../../gcc/cp/mangle.cc:2775 0x781699 write_encoding ../../gcc/cp/mangle.cc:855 0x781c11 mangle_decl_string ../../gcc/cp/mangle.cc:4054 0x781e3b get_mangled_id ../../gcc/cp/mangle.cc:4075 0x781e3b mangle_decl(tree_node*) ../../gcc/cp/mangle.cc:4113 0x1016af2 decl_assembler_name(tree_node*) ../../gcc/tree.cc:700 0x9901ef symtab_node::get_comdat_group_id() ../../gcc/cgraph.h:254 0x9901ef analyze_functions ../../gcc/cgraphunit.cc:1192 0x9913bd symbol_table::finalize_compilation_unit() ../../gcc/cgraphunit.cc:2500