https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107152
Bug ID: 107152
Summary: ICE: Segmentation fault (in get_shorthand_constraints)
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
g++ 13.0.0 20220925 snapshot (g:77bbf69d2981dafc2ef3e59bfbefb645d88bab9d) ICEs
when compiling the following testcase, reduced from
test/Modules/template-function-specialization.cpp from the clang 15.0.1 test
suite:
export template <>
void foo4<int>() {
}
% g++-13.0.0 -std=c++20 -w -c rnforwjm.cpp
rnforwjm.cpp:1:18: error: invalid explicit specialization before '>' token
1 | export template <>
| ^
rnforwjm.cpp:1:18: internal compiler error: Segmentation fault
0x11dc98f crash_signal
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/toplev.cc:314
0x9c7cd6 tree_check(tree_node*, char const*, int, char const*, tree_code)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/tree.h:3519
0x9c7cd6 get_shorthand_constraints(tree_node*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/constraint.cc:1558
0xb2de2b cp_parser_explicit_template_declaration
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:31825
0xb3094a cp_parser_declaration
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:15038
0xb31509 cp_parser_toplevel_declaration
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:15130
0xb31509 cp_parser_translation_unit
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:5068
0xb31509 c_parse_file()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:48606
0xc6e3a1 c_common_parse_file()
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/c-family/c-opts.cc:1255