2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / Wattributes.C
blob35fae03568332b5813dd3057cadc2a43bac0c7e0
1 // PR c++/38611
2 // { dg-do compile }
4 struct A { unsigned char a [272]; };
6 typedef struct __attribute__ ((aligned (128))) A B;   // { dg-warning "attributes ignored" }
7 typedef struct __attribute__ ((__may_alias__)) A C;   // { dg-warning "attributes ignored" }
9 #ifndef __cplusplus
10 #  define alignof       _Alignof
11 #  define static_assert _Static_assert
12 #elif __cplusplus < 201103L
13 #  define alignof __alignof__
14 #  define static_assert(expr, ignore) typedef int Assert [(expr) ? 1 : -1]
15 #endif
17 #define SA(expr) static_assert ((expr), #expr)
19 SA (alignof (struct A) == alignof (B));