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

--- Comment #3 from shyeyian <shyeyian at petalmail dot com> ---
Sorry, the hello.cpp is not correct. This time gcc will ICE:
===== helllo.cpp =====
struct S
{
    int x;
    void f()
    {
        auto l = [&] (this auto) { (void)x; };
        l(); // I forgot the line here. Sorry!
    }
};

===== command line, Arch Linux, g++ 15.2 =====
[shyeyian@matebook test]$ g++ -std=c++23 hello.cpp
hello.cpp: In instantiation of 'S::f()::<lambda(this auto:1)> [with auto:1 =
S::f()::<lambda(this auto:1)>]':
hello.cpp:7:10:   required from here
    7 |         l();
      |         ~^~
hello.cpp:6:42: internal compiler error: Segmentation fault
    6 |         auto l = [&] (this auto) { (void)x; };
      |                                          ^
0x26ef811 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2749918 internal_error(char const*, ...)
        ???:0
0x9423b5 perform_or_defer_access_check(tree_node*, tree_node*, tree_node*, int,
access_failure_info*)
        ???:0
0x943feb finish_non_static_data_member(tree_node*, tree_node*, tree_node*, int)
        ???:0
0x923a2a tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x928f4d instantiate_decl(tree_node*, bool, bool)
        ???:0
0x7b78d2 maybe_instantiate_decl(tree_node*)
        ???:0
0x7c9317 mark_used(tree_node*, int)
        ???:0
0x754c99 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ???:0
0x946bb6 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ???:0
0xa238f0 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues>
for instructions.

=====

Thanks!

Reply via email to