itanium-cxx-abi / cxx-abi

C++ ABI Summary
507 stars 95 forks source link

Lambda POD for the purposes of layout? #156

Open dwblaikie opened 2 years ago

dwblaikie commented 2 years ago

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?

frederick-vs-ja commented 1 year 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.

dwblaikie commented 1 year ago

Thanks for the chapter and verse. Filed a gcc bug here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109114