2 // { dg-do compile { target c++11 } }
3 // { dg-additional-options "-fabi-version=16 -Wabi" }
11 // { dg-warning "offset" "" { target c++14 } .-1 }
14 #define SA(X) static_assert(X,#X)
15 SA(sizeof (B) == sizeof (A));
16 // { dg-error "static assertion" "" { target c++14 } .-1 }
20 // { dg-warning "offset" "" { target c++14 } .-1 }
21 SA(sizeof (B2) == sizeof (A));
22 // { dg-error "static assertion" "" { target c++14 } .-1 }
24 #if __cplusplus > 201800L
27 [[no_unique_address]] A a;
29 // { dg-warning "offset" "" { target c++20 } .-1 }
31 SA(sizeof (C) == sizeof (A));
32 // { dg-error "static assertion" "" { target c++20 } .-1 }
35 // { dg-warning "offset" "" { target c++20 } .-1 }
36 SA(sizeof (B2) == sizeof (A));
37 // { dg-error "static assertion" "" { target c++20 } .-1 }