Hi!

The same testcase as has been used for powerpc64le-linux can be
used for aarch64-linux too:

struct X { };
struct Y { int : 0; };
struct Z { int : 0; Y y; };
struct U : public X { X q; };
struct A { float a, b, c, d; };
struct B : public X { float a, b, c, d; };
struct C : public Y { float a, b, c, d; };
struct D : public Z { float a, b, c, d; };
struct E : public U { float a, b, c, d; };
struct F { [[no_unique_address]] X x; float a, b, c, d; };
struct G { [[no_unique_address]] Y y; float a, b, c, d; };
struct H { [[no_unique_address]] Z z; float a, b, c, d; };
struct I { [[no_unique_address]] U u; float a, b, c, d; };
struct J { float a, b; [[no_unique_address]] X x; float c, d; };
struct K { float a, b; [[no_unique_address]] Y y; float c, d; };
struct L { float a, b; [[no_unique_address]] Z z; float c, d; };
struct M { float a, b; [[no_unique_address]] U u; float c, d; };
#define T(S, s) extern S s; extern void foo##s (S); int bar##s () { foo##s (s); 
return 0; }
T (A, a)
T (B, b)
T (C, c)
T (D, d)
T (E, e)
T (F, f)
T (G, g)
T (H, h)
T (I, i)
T (J, j)
T (K, k)
T (L, l)
T (M, m)

Here, G++ 9 -std=c++17 passes just A in s0-s3 and the rest elsewhere,
G++ 9 -std=c++17 and current trunk -std=c++14 & -std=c++17 passes
A, B, C in s0-s3 and the rest elsewhere, and
clang++ from today passes A, B, C, F, G, J, K in s0-s3 and the rest
elsewhere.

So, if we want to follow and handle [[no_unique_address]] empty fields
like C++17 empty bases, we need similar patch to what I've posted for
powerc64le-linux, subject to any changes in how we want to check for
those fields.

Haven't checked ARM 32-bit, I don't even know what exact options are needed
for that.

        Jakub

Reply via email to