https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107422
Bug ID: 107422 Summary: [12/13 Regression] ICE in lvalue_kind, at cp/tree.cc:293 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started with r12 before 20210502 : (gcc configured with --enable-checking=yes) $ cat z1.cc typedef decltype (__builtin_trap) t; template <int> struct s; union { template <int a> using b = decltype (t () (s <a> {})); template <int a> b <a> get (); }; // } u; $ g++-13-20221023 -c z1.cc -fno-pretty-templates z1.cc:5:26: error: 'template<int a> using<unnamed union>::b = decltype (t()(s<a>{}))' invalid; an anonymous union may only have public non-static data members [-fpermissive] 5 | template <int a> using b = decltype (t () (s <a> {})); | ^ ' Segmentation fault 7 | }; // } u; | ^ 0x11d0e4f crash_signal ../../gcc/toplev.cc:314 0xb15510 lvalue_kind(tree_node const*) ../../gcc/cp/tree.cc:293 0xae9fa7 finish_decltype_type(tree_node*, bool, int) ../../gcc/cp/semantics.cc:11488 0xb271af strip_typedefs(tree_node*, bool*, unsigned int) ../../gcc/cp/tree.cc:1788 0x91ae45 dump_type ../../gcc/cp/error.cc:538 0x91a6fc dump_type_prefix ../../gcc/cp/error.cc:981 0x92578d dump_function_decl ../../gcc/cp/error.cc:1804 0x9287f6 decl_to_string ../../gcc/cp/error.cc:3297 0x9287f6 cp_printer ../../gcc/cp/error.cc:4471 0x2202490 pp_format(pretty_printer*, text_info*) ../../gcc/pretty-print.cc:1475 0x21e13c0 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) ../../gcc/diagnostic.cc:1548 0x21e1b0a diagnostic_impl ../../gcc/diagnostic.cc:1712 0x21e224a permerror(unsigned int, char const*, ...) ../../gcc/diagnostic.cc:1979 0x8c30e7 fixup_anonymous_aggr(tree_node*) ../../gcc/cp/decl.cc:5194 0x8ea67c shadow_tag(cp_decl_specifier_seq*) ../../gcc/cp/decl.cc:5498 0xa011c9 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15422 0xa35d9b cp_parser_declaration ../../gcc/cp/parser.cc:14970 0xa368b8 cp_parser_translation_unit ../../gcc/cp/parser.cc:5076 0xa368b8 c_parse_file() ../../gcc/cp/parser.cc:48860 0xbcef21 c_common_parse_file() ../../gcc/c-family/c-opts.cc:1247