https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114242
--- Comment #5 from Andreas Fertig <src at andyf dot de> --- My latest conclusion is that my code is indeed invalid. In the case of the lambda, I have a class type. http://eel.is/c++draft/dcl.fct.def.coroutine#4 says that in such a case, p1 is an lvalue of *this. If I modify my original example, g++ and MSVC accept the code, but Clang now rejects it: https://compiler-explorer.com/z/1hhxfYW1v I will open an issue there and let them confirm. But I think we can close this issue for g++.