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

            Bug ID: 125753
           Summary: [reflection] ICE with -g, when aliasing type from
                    splicer inside an expansion statement in a constructor
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikotin98 at gmail dot com
  Target Milestone: ---

Compiled with
-g -std=c++26 -freflection

Tested on 16.1 on Linux, Windows and godbolt: https://godbolt.org/z/fb7KzPGca

--------------------
#include <meta>
namespace A {
}

class C {
    C();
};

C::C() {
    constexpr auto ctx = std::meta::access_context::current();
    constexpr static auto members =
std::define_static_array(std::meta::members_of(^^A, ctx));
    template for (constexpr auto member : members) {
        using member_type = typename[:member:];
    }
}
--------------------

test.cpp: In constructor ‘C::C()’:
test.cpp:23:1: internal compiler error: in is_base_type, at dwarf2out.cc:13503
   23 | }
      | ^
0x24492bf internal_error(char const*, ...)
        ../../gcc-16.1.0/gcc/diagnostic-global-context.cc:787
0x845433 fancy_abort(char const*, int, char const*)
        ../../gcc-16.1.0/gcc/diagnostics/context.cc:1813
0x804461 is_base_type
        ../../gcc-16.1.0/gcc/dwarf2out.cc:13503
0x804461 is_base_type
        ../../gcc-16.1.0/gcc/dwarf2out.cc:13468
0x804461 modified_type_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:13919
0xca6948 add_type_attribute
        ../../gcc-16.1.0/gcc/dwarf2out.cc:22764
0xc9fa60 gen_typedef_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:26676
0xc9fa60 gen_typedef_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:26610
0xc9fa60 gen_decl_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27653
0xcbd58f decls_for_scope
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27189
0xcbd60a gen_block_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27032
0xcbd60a decls_for_scope
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27218
0xcbd60a gen_block_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27032
0xcbd60a decls_for_scope
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27218
0xcbd60a gen_block_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27032
0xcbd60a decls_for_scope
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27218
0xc9b857 gen_subprogram_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:24597
0xc9f2ed gen_decl_die
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27627
0xca07d8 dwarf2out_decl
        ../../gcc-16.1.0/gcc/dwarf2out.cc:28227
0xca0ca3 dwarf2out_early_global_decl
        ../../gcc-16.1.0/gcc/dwarf2out.cc:27843
/opt/gcc-16.1/libexec/gcc/x86_64-pc-linux-gnu/16.1.0/cc1plus -quiet -imultiarch
x86_64-linux-gnu -D_GNU_SOURCE test.cpp -quiet -dumpdir a- -dumpbase test.cpp
-dumpbase-ext .cpp -mtune=generic -march=x86-64 -g -std=c++26 -freflection -o
/tmp/ccB1rmZ0.s

Reply via email to