Open dwblaikie opened 2 years ago
When captures exist, the lambda closure type doesn't have default constructor ([expr.prim.lambda.closure]/14) and hence not a POD. I think it's clear that such lambdas are not POD for the purposes of layout either.
Thanks for the chapter and verse. Filed a gcc bug here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109114
Someone came across an inconsistency between GCC and Clang when it comes to determining POD-for-the-purposes-of-layout: https://github.com/llvm/llvm-project/issues/59078
So, should lambdas be POD if their capture members are POD?