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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 63922
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63922&action=edit
gcc16-pr124487-wip.patch

WIP patch.
Unfortunately this breaks pack-indexing9.C testcase:
FAIL: g++.dg/cpp26/pack-indexing9.C  -std=c++26 (internal compiler error: tree
check: expected type_pack_expansion or expr_pack_expansion, have tree_vec in
write_type, at cp/mangle.cc:2750)
FAIL: g++.dg/cpp26/pack-indexing9.C  -std=c++26  (test for warnings, line 19)
FAIL: g++.dg/cpp26/pack-indexing9.C  -std=c++26 (test for excess errors)

while some adjustment is certainly needed, we shouldn't expect a sorry message,
the ICE is on
 <pack_index_type 0x7fffe99cfb28
    type <tree_vec 0x7fffe982b330 length:3
        elt:0 <integer_type 0x7fffe98233f0 char public type_6 QI
            size <integer_cst 0x7fffe981b3c0 constant 8>
            unit-size <integer_cst 0x7fffe981b3d8 constant 1>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffe98233f0 precision:8 min <integer_cst 0x7fffe981b408 -128> max
<integer_cst 0x7fffe981b438 127>
            pointer_to_this <pointer_type 0x7fffe982df18>>
        elt:1 <integer_type 0x7fffe98235e8 int public type_6 SI
            size <integer_cst 0x7fffe981b510 constant 32>
            unit-size <integer_cst 0x7fffe981b528 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffe98235e8 precision:32 min <integer_cst 0x7fffe981b4c8 -2147483648> max
<integer_cst 0x7fffe981b4e0 2147483647>
            pointer_to_this <pointer_type 0x7fffe982ab28>>
        elt:2 <real_type 0x7fffe982a348 double type_6 DF
            size <integer_cst 0x7fffe981b2d0 constant 64>
            unit-size <integer_cst 0x7fffe981b2e8 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffe982a348 precision:64
            pointer_to_this <pointer_type 0x7fffe982a9d8>>>
    VOID
    align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality pack
<tree_vec 0x7fffe982b330>
    index <template_parm_index 0x7fffe982b360 type <integer_type 0x7fffe98235e8
int>
        readonly constant
        decl <const_decl 0x7fffe980f7f8 I type <integer_type 0x7fffe98235e8
int>
            readonly constant decl_0 VOID pack-indexing9.C:19:14
            align:1 warn_if_not_align:0 initial <template_parm_index
0x7fffe982b360>>
       index 0 level 1 orig_level 2>>
So, clearly PACK_INDEX_PACK is no longer some pack expansion, but the expanded
pack.  Guess for mangling we need what it has been expanded from?

Reply via email to