Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda POD for the purposes of layout? #156

Open
dwblaikie opened this issue Nov 21, 2022 · 2 comments
Open

Lambda POD for the purposes of layout? #156

dwblaikie opened this issue Nov 21, 2022 · 2 comments

Comments

@dwblaikie
Copy link

Someone came across an inconsistency between GCC and Clang when it comes to determining POD-for-the-purposes-of-layout: llvm/llvm-project#59078

So, should lambdas be POD if their capture members are POD?

@frederick-vs-ja
Copy link
Contributor

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants