https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95193
Bug ID: 95193
Summary: [11 Regression] ICE in tsubst_decl, at cp/pt.c:14624
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
gcc-11.0.0-alpha20200517 snapshot (g:2b9a271b2d0ba340234a138b7f8289bd7dca2fc5)
ICEs when compiling the following testcase, extracted from
test/SemaCXX/cxx1z-lambda-star-this.cpp from the clang 10.0.0 test suite, w/
-std=c++17:
struct X {
void foo() const {
auto GL1 = [*this](auto a) {
};
GL1("abc");
}
};
% g++-11.0.0 -std=c++17 -c g5fztf1w.cpp
g5fztf1w.cpp: In instantiation of 'X::foo() const::<lambda(auto:1)> [with
auto:1 = const char*]':
g5fztf1w.cpp:6:14: required from here
g5fztf1w.cpp:3:30: internal compiler error: in tsubst_decl, at cp/pt.c:14624
3 | auto GL1 = [*this](auto a) {
| ^
0x662811 tsubst_decl
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:14624
0x9fa006 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:17921
0x9f8267 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:18138
0x9f536a instantiate_decl(tree_node*, bool, bool)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/pt.c:25609
0x926d1a maybe_instantiate_decl
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/decl2.c:5377
0x929558 maybe_instantiate_decl
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/tree.h:3411
0x929558 mark_used(tree_node*, int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/decl2.c:5573
0x87afa3 build_over_call
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:9077
0x87ff91 build_op_call_1
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:4883
0x87ff91 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/call.c:4912
0xa3d83e finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/semantics.c:2692
0x9b3e51 cp_parser_postfix_expression
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:7465
0x9958e9 cp_parser_binary_expression
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:9559
0x99759e cp_parser_assignment_expression
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:9864
0x997963 cp_parser_expression
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:10032
0x99a918 cp_parser_expression_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:11692
0x9a5f73 cp_parser_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:11488
0x9a7828 cp_parser_statement_seq_opt
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:11839
0x9a7908 cp_parser_compound_statement
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:11789
0x9bfcf5 cp_parser_function_body
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200517/work/gcc-11-20200517/gcc/cp/parser.c:23058