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

            Bug ID: 124456
           Summary: ICE: tree check: expected tree_vec, have array_ref in
                    tsubst_pack_expansion, at cp/pt.cc:14138
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc-bugs at deta dot lv
  Target Milestone: ---

Created attachment 63899
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63899&action=edit
reduced testcase (test.cpp)

Hello!

I've got an ICE likely related to a structured binding pack expansion:
---------------------
test.cpp: In instantiation of ‘auto h(auto:6&&, auto:7 ...) [with auto:6 =
<lambda(auto:9 ...)>; auto:7 = {}]’:
test.cpp:12:11:   required from here
   12 | auto x = h([](auto...) {});
      |          ~^~~~~~~~~~~~~~~~
test.cpp:8:15: internal compiler error: tree check: expected tree_vec, have
array_ref in tsubst_pack_expansion, at cp/pt.cc:14138
    8 |     return fun(k...);
      |            ~~~^~~~~~
0x2b5e0bf internal_error(char const*, ...)
        ../../gcc/diagnostic-global-context.cc:787
0xa8d725 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.cc:9219
0x8da809 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/tree.h:3780
0x8da809 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.cc:14138
0xe58797 tsubst_call_args
        ../../gcc/cp/pt.cc:21160
0xe3756f tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.cc:22047
0xe67a0f tsubst_stmt
        ../../gcc/cp/pt.cc:20665
0xe68d33 tsubst_stmt
        ../../gcc/cp/pt.cc:19448
0xe68cf0 tsubst_stmt
        ../../gcc/cp/pt.cc:19438
0xe6943d tsubst_stmt
        ../../gcc/cp/pt.cc:19859
0xe68cf0 tsubst_stmt
        ../../gcc/cp/pt.cc:19438
0xe368c1 tsubst_stmt
        ../../gcc/cp/pt.cc:19427
0xe368c1 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.cc:21060
0xe38df1 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.cc:23062
0xe67a0f tsubst_stmt
        ../../gcc/cp/pt.cc:20665
0xe68d33 tsubst_stmt
        ../../gcc/cp/pt.cc:19448
0xe68cf0 tsubst_stmt
        ../../gcc/cp/pt.cc:19438
0xe6943d tsubst_stmt
        ../../gcc/cp/pt.cc:19859
0xe70866 tsubst_stmt
        ../../gcc/cp/pt.cc:19427
0xe70866 instantiate_body
        ../../gcc/cp/pt.cc:28485
/usr/local/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet -imultiarch
x86_64-linux-gnu -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -dumpbase-ext
.cpp -mtune=generic -march=x86-64 -Wfatal-errors -std=c++26 -o /tmp/ccaG5FV3.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
---------------------
A reduced testcase attached.

BR,
AZ

Reply via email to