Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/no_unique_address4.C

raw
1 // PR c++/96105
2 // { dg-do compile { target c++20 } }
3
4 struct Empty {};
5
6 struct A {
7 Empty emp [[no_unique_address]][3];
8 };
9
10 struct B : A {
11 float f;
12 };
13
14 struct C {
15 Empty emp [[no_unique_address]][3];
16 float f;
17 };
18
19 extern char szc[sizeof(C)];
20 extern char szc[sizeof(float) * 2]; // GCC likes this
21 extern char szb[sizeof(B)];
22 extern char szb[sizeof(float) * 2]; // GCC does not like this