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

            Bug ID: 128543
           Summary: ICE on contract assertion of throwing
                    `std::meta::is_base_of_type()`
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ivan.lazaric.gcc at gmail dot com
  Target Milestone: ---

```cpp
#include <meta>

consteval {
    contract_assert(is_base_of_type(^^int, {}));
}
```

Flags: "-freflection -std=c++26"

https://godbolt.org/z/3GerezWGs

```
blah.cpp:5:1:   in 'constexpr' expansion of '<lambda()> static()'
    5 | }
      | ^
blah.cpp:4:5: internal compiler error: Segmentation fault
    4 |     contract_assert(is_base_of_type(^^int, {}));
      |     ^~~~~~~~~~~~~~~
0x2ebd1fb internal_error(char const*, ...)
       
/home/ilazaric/repos/ALL/submodules/gcc/gcc/diagnostic-global-context.cc:787
0x2908903 crash_signal
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/toplev.cc:325
0x7fff8564532f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x2c8a238 location_wrapper_p(tree_node const*)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/tree.h:4604
0x2c8a238 tree_strip_any_location_wrapper(tree_node*)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/tree.h:4616
0x2c8a238 integer_zerop(tree_node const*)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/tree.cc:3010
0x121893e cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:11382
0x12148d4 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:11210
0x12127b7 cxx_eval_call_expression
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:5117
0x1214b7c cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:10155
0x121560b cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:10674
0x1221f23 cxx_eval_outermost_constant_expr
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:11819
0x1223198 cxx_eval_outermost_constant_expr
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:11670
0x1223198 cxx_constant_value(tree_node*, tree_node*, int)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/constexpr.cc:12062
0x141dbce finish_static_assert(tree_node*, tree_node*, unsigned long, bool,
bool, bool)
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/semantics.cc:13391
0x1377a17 cp_parser_consteval_block
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/parser.cc:17999
0x139dcef cp_parser_declaration
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/parser.cc:17847
0x13a0342 cp_parser_toplevel_declaration
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/parser.cc:17951
0x13a0342 cp_parser_translation_unit
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/parser.cc:5685
0x13a0342 c_parse_file()
        /home/ilazaric/repos/ALL/submodules/gcc/gcc/cp/parser.cc:58160
/opt/GCC-release/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1plus -quiet
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE blah.cpp -quiet -dumpdir a-
-dumpbase blah.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++26
-freflection -o /tmp/ccecHdLv.s
```

Reply via email to