discovered compiler crash on gcc 15.2.1

20 hours ago 11

hi,

as i was working on my c++ side project, i accidentally stumbled upon a bug in latest gcc.

the following code results in an internal compiler error, when compiling via `g++ main.cc -std=c++23`. (note: clang compiles this just fine)

struct S { int x; void f() { [&](this const auto&) { x; }(); } }; int main() { }

is this bug known, or has anyone here seen it before?

if not im going to report it, and maybe even try to fix it myself.

edit: godbolt link https://godbolt.org/z/zE75nKj4E

submitted by /u/lukasx_ to r/cpp
[link] [comments]
Read Entire Article