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

            Bug ID: 124297
           Summary: ICE in write_type_constraint, at cp/mangle.cc:913
           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 63795
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63795&action=edit
test.cpp - a reduced test case

Hello!

While trying to (c)reduce a strange error message regarding mangle, I actually
run into an ICE:

-------------------------------------
test.cpp:11:41: internal compiler error: in write_type_constraint, at
cp/mangle.cc:913
   11 | template <q auto... n, typename h> auto p(h l) {
      |                                         ^
0x2b624ff internal_error(char const*, ...)
        ../../gcc/diagnostic-global-context.cc:787
0xba6d03 fancy_abort(char const*, int, char const*)
        ../../gcc/diagnostics/context.cc:1812
0x8905d5 write_type_constraint
        ../../gcc/cp/mangle.cc:913
0xd17899 write_template_args
        ../../gcc/cp/mangle.cc:3303
0xd12c4b write_encoding
        ../../gcc/cp/mangle.cc:944
0xd12e39 write_mangled_name
        ../../gcc/cp/mangle.cc:833
0xd18806 mangle_decl_string
        ../../gcc/cp/mangle.cc:4723
0xd1896f get_mangled_id
        ../../gcc/cp/mangle.cc:4739
0xd1896f mangle_decl(tree_node*)
        ../../gcc/cp/mangle.cc:4777
0x19f0e3a decl_assembler_name(tree_node*)
        ../../gcc/tree.cc:856
0x1082b68 symtab_node::get_comdat_group_id()
        ../../gcc/cgraph.h:289
0x1082b68 analyze_functions
        ../../gcc/cgraphunit.cc:1222
0x1084252 symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.cc:2593
/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 -Wall -Wextra -std=c++26 -o /tmp/ccssQuHI.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 test case attached.
cmd line: g++ -std=c++26 -Wall -Wextra -c test.cpp

According to godbolt.org, the test case compiles with gcc 15.2 (-std=c++23)

BR,
AZ

Reply via email to