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

            Bug ID: 123695
           Summary: Internal compiler error: segmentation fault in
                    eval_object_of in reflect.cc:2620
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: srytting at pm dot me
  Target Milestone: ---

Created attachment 63390
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63390&action=edit
Preprocessed source causing the error

## GCC Version, system, and options:
```
    Using built-in specs.
    COLLECT_GCC=gcc
   
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
    Target: x86_64-pc-linux-gnu
    Configured with: ../gcc/configure --disable-multilib
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 16.0.1 20260116 (experimental) (GCC)
```

## Command line:
`g++ main.cpp -std=c++26 -freflection -Wall -Wextra`

## Compiler output:

```
main.cpp: In function ‘int main(int, char**)’:
main.cpp:24:57: error: uncaught exception of type ‘std::meta::exception’;
‘what()’: ‘reflection does not represent parameter of current function’
   24 |     constexpr auto temp = std::meta::variable_of(intInfo);
      |                                                         ^
main.cpp:25:48: internal compiler error: Segmentation fault
   25 |     constexpr auto temp2 = std::meta::object_of(intInfo);
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
0x273120f internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:787
0x121fd4f crash_signal
        ../../gcc/gcc/toplev.cc:325
0xa73014 eval_object_of
        ../../gcc/gcc/cp/reflect.cc:2620
0xa73014 process_metafunction(constexpr_ctx const*, tree_node*, tree_node*,
bool*, bool*, tree_node**)
        ../../gcc/gcc/cp/reflect.cc:7443
0x7f4285 cxx_eval_call_expression
        ../../gcc/gcc/cp/constexpr.cc:3867
0x7f7c30 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        ../../gcc/gcc/cp/constexpr.cc:9205
0x8099f7 cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/constexpr.cc:10717
0x811147 maybe_constant_value(tree_node*, tree_node*, mce_value)
        ../../gcc/gcc/cp/constexpr.cc:11139
0xafb929 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/gcc/cp/typeck2.cc:969
0x89546b check_initializer
        ../../gcc/gcc/cp/decl.cc:8638
0x89ac5e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ../../gcc/gcc/cp/decl.cc:9901
0x9d64d7 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.cc:26256
0x9d9728 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.cc:17991
0x9da6ae cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.cc:16850
0x99d4c7 cp_parser_statement
        ../../gcc/gcc/cp/parser.cc:14415
0x9a0d30 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.cc:14996
0x9a101f cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.cc:14843
0x9d0835 cp_parser_function_body
        ../../gcc/gcc/cp/parser.cc:28714
0x9d0835 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.cc:28765
0x9a137f cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.cc:35962
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.
```

Reply via email to