aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/no_unique_address4.C
blob: c62cfe1f2c18f95f6260386ad5a54fa935d543d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Test that [[no_unique_address]] makes the enclosing class non-layout-POD.
// { dg-do compile { target c++11 } }

struct A {};
struct B1: A {
  int i;
  char c;
};

struct B2 {
  [[no_unique_address]] A a;
  int i;
  char c;
};

struct C1: B1 {
  char d;
};

struct C2: B2 {
  char d;
};

#define SA(X) static_assert((X),#X)
SA(sizeof(C1) == sizeof(C2));