Bug 107152 - ICE: Segmentation fault (in get_shorthand_constraints)
Summary: ICE: Segmentation fault (in get_shorthand_constraints)
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2022-10-04 12:50 UTC by Arseny Solokha
Modified: 2022-10-07 19:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2022-10-04 12:50:14 UTC
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