[Bug c++/126870] New: ICE segfault on reference initialized to extracted reflection of itself

"eczbek.void at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126870

            Bug ID: 126870
           Summary: ICE segfault on reference initialized to extracted
                    reflection of itself
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/d1e4c3s4e

```
#include <meta>

constexpr const int& r = std::meta::extract<const int&>(^^r);
```

```
<source>:3:56: internal compiler error: Segmentation fault
    3 | constexpr const int& r = std::meta::extract<const int&>(^^r);
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
0x2bb9ec8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2baeb0b internal_error(char const*, ...)
        ???:0
0xe2489c process_metafunction(constexpr_ctx const*, tree_node*, tree_node*,
bool*, bool*, tree_node**)
        ???:0
0xbb2321 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        ???:0
0xbb18b2 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        ???:0
0xbb18b2 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        ???:0
0xbcb379 maybe_constant_value(tree_node*, tree_node*, mce_value)
        ???:0
0xeaacc7 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0xc56656 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ???:0
0xd9a313 c_parse_file()
        ???:0
0xf2d8a9 c_common_parse_file()
        ???:0
/cefs/05/0541330772b8b6bab5825a2a_gcc-trunk-20260814/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/05/0541330772b8b6bab5825a2a_gcc-trunk-20260814/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE <source> -quiet -dumpdir /app/ -dumpbase output.cpp -dumpbase-ext
.cpp -masm=intel -mtune=generic -march=x86-64 -g -Wpedantic -Wall -Wextra
-Wconversion -Wsign-conversion -std=c++26 -fdiagnostics-color=always
-fno-verbose-asm -freflection -o /app/output.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.
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.