[clang] [Clang] Explain why is_standard_layout evaluated to false (PR #143722)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 12 02:35:16 PDT 2025
cor3ntin wrote:
Thanks a lot for working on that.
Can you add tests for all of these examples?
https://eel.is/c++draft/class.prop#11
In particular
- If there are multiple direct base classes, a type is not a standard layout
- If in the inheritance hierarchy, there are multiple classes with members, it is not _standard-layout_.
We have `CXXRecordDecl::hasDirectFields()` and `CXXRecordDecl::getStandardLayoutBaseWithFields` that should help
https://github.com/llvm/llvm-project/pull/143722
More information about the cfe-commits
mailing list