https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120748
Bug ID: 120748 Summary: New crash with lambda code Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- For this C++ code: namespace PR45881 { struct A { void f(); }; int id(A*); void A::f() { auto z = [*this](auto z2, decltype(z2(this)) z3){}; z(id,3); } struct B { void f(); }; void B::f() { auto z = []<typename TT, typename TTT=decltype(TT()(this))>(){return 0;}; z.template operator()<int(*)(B*)>(); } struct C { void f(); }; void C::f() { auto z = []<typename TT, decltype(TT()(this)) n>(){return 0;}; z.template operator()<int(*)(C*), 8>(); } } // namespace PR45881 copied from clang's C++ testsuite, recent g++ does this: test $ ~/gcc/results.20250620.asan.ubsan/bin/g++ -c -w ./SemaCXX/cxx20-lambda-decltype-this.cpp g++: internal compiler error: Segmentation fault signal terminated program cc1plus clang++ seems quite happy with it: test $ ~/llvm/results.20250619/bin/clang++ -c -w ./SemaCXX/cxx20-lambda-decltype-this.cpp test $ This problem first seems to occur sometime between g:5c6364b09a67de8d and g:e131ba3de5f487f5.