https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107401
Bug ID: 107401
Summary: ICE in get_originating_module_decl, at
cp/module.cc:18587
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
With file g++.dg/parse/pr81247-a.C and pr81247-b.C :
$ g++-13-20221023 -c pr81247-a.C -fmodules-ts
pr81247-a.C:5:1: error: expected '{' before 'template'
5 | template < typename T > class A
| ^~~~~~~~
'
pr81247-a.C: In instantiation of 'class A<int>':
pr81247-a.C:12:13: required from here
Segmentation fault
6 | { // { dg-error "redeclared as different" }
| ^
0x11d299f crash_signal
../../gcc/toplev.cc:314
0x98b3c7 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/tree.h:3648
0x98b3c7 get_originating_module_decl(tree_node*)
../../gcc/cp/module.cc:18587
0x98b687 get_originating_module(tree_node*, bool)
../../gcc/cp/module.cc:18626
0x919fa6 dump_module_suffix
../../gcc/cp/error.cc:207
0x91acba dump_module_suffix
../../gcc/cp/error.cc:189
0x91acba dump_aggr_type
../../gcc/cp/error.cc:856
0x9294f6 decl_to_string
../../gcc/cp/error.cc:3297
0x9294f6 cp_printer
../../gcc/cp/error.cc:4471
0x22113c0 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1475
0x21f02f0 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1548
0x21f0a3a diagnostic_impl
../../gcc/diagnostic.cc:1712
0x21f1286 error(char const*, ...)
../../gcc/diagnostic.cc:2008
0x8d8196 duplicate_decls(tree_node*, tree_node*, bool, bool)
../../gcc/cp/decl.cc:1814
0x9cd5a3 pushdecl(tree_node*, bool)
../../gcc/cp/name-lookup.cc:3686
0x9d0012 do_pushdecl_with_scope
../../gcc/cp/name-lookup.cc:4769
0x9d022e pushdecl_namespace_level(tree_node*, bool)
../../gcc/cp/name-lookup.cc:6126
0xabb63a tsubst_friend_class
../../gcc/cp/pt.cc:11589
0xabb63a instantiate_class_template(tree_node*)
../../gcc/cp/pt.cc:12320
0xb2b3e6 complete_type(tree_node*)
../../gcc/cp/typeck.cc:138