[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

Barry Revzin via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 2 20:58:08 PDT 2025


brevzin wrote:

Oh. Actually I didn't quite properly implement the destructor rule, since that changed since I originally implemented this. The new rule is that the default destructor for a union `X` [is deleted if](http://eel.is/c++draft/class.dtor#7.2)

* default constructing an `X` either fails, or is deleted, or is non trivial, or
* one of the members `M` of `X` has a default member initializer and `M`'s destructor is non-trivial.

I don't know how to do that yet, so plz don't merge (although I suspect there are other changes to be made).

https://github.com/llvm/llvm-project/pull/146815


More information about the cfe-commits mailing list