[Bug c++/94483] New: [10 Regression] ICE: tree check: expected type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607

asolokha at gmx dot com gcc-bugzilla@gcc.gnu.org
Sat Apr 4 06:46:44 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94483

            Bug ID: 94483
           Summary: [10 Regression] ICE: tree check: expected
                    type_pack_expansion, have error_mark in add_capture,
                    at cp/lambda.c:607
           Product: gcc
           Version: 10.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++-10.0.1-alpha20200329 snapshot (g:60c254b279e8e8443b8ad26cc46b9e4084cff66c)
ICEs when compiling the following testcase, extracted from
test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp from the clang 10.0.0
test suite, w/ -std=c++2a:

template<int ...a> constexpr auto x = [...z = a] (auto F) { return F(z...); };

% g++-10.0.1 -std=c++2a -c elqdcpvu.cpp
elqdcpvu.cpp:1:47: error: expansion pattern 'int' contains no parameter packs
    1 | template<int ...a> constexpr auto x = [...z = a] (auto F) { return
F(z...); };
      |                                               ^
elqdcpvu.cpp:1:47: internal compiler error: tree check: expected
type_pack_expansion, have error_mark in add_capture, at cp/lambda.c:607
0x7bb258 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/tree.c:9737
0x62bdea tree_check(tree_node*, char const*, int, char const*, tree_code)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/tree.h:3278
0x62bdea add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/lambda.c:607
0x99dad1 cp_parser_lambda_introducer
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10928
0x99dad1 cp_parser_lambda_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10530
0x99dad1 cp_parser_primary_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:5413
0x9a8487 cp_parser_postfix_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:7257
0x98a669 cp_parser_binary_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:9554
0x98c31e cp_parser_assignment_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:9859
0x98b005 cp_parser_constant_expression
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:10153
0x98b7a1 cp_parser_initializer_clause
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:23218
0x98fe5f cp_parser_initializer
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:23156
0x9b8943 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:20850
0x9bf954 cp_parser_single_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29479
0x9bfadc cp_parser_template_declaration_after_parameters
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29051
0x9c0240 cp_parser_explicit_template_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:29317
0x9c3459 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13379
0x9c3a9f cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:4731
0x9c3a9f c_parse_file()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:43944
0xadbadb c_common_parse_file()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/c-family/c-opts.c:1186


More information about the Gcc-bugs mailing list