[PATCH] D139741: [clang][CodeGen] Use base subobject type layout for potentially-overlapping fields

Vladislav Dzhidzhoev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 16 13:01:03 PST 2022


dzhidzhoev added a comment.

In D139741#4002244 <https://reviews.llvm.org/D139741#4002244>, @efriedma wrote:

> Does the following work with the updated patch?
>
>   class Empty {};
>   class UnionClass : Empty {
>     [[no_unique_address]] union X {
>     private:
>       Empty x;
>       alignas(2) char C;
>     } U;
>     char C;
>   };
>   UnionClass L;

Unfortunately no, it fails on the same assert as the current trunk as soon as unions are ignored.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139741/new/

https://reviews.llvm.org/D139741



More information about the cfe-commits mailing list