2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wno-attributes" }
5 alignas (0) int valid1;
6 alignas (1 - 1) int valid2;
10 alignas (2 * 0) int j;
13 alignas (-1) int invalid1; /* { dg-error "not a positive power of 2" } */
14 alignas (1 - 2) int invalid2; /* { dg-error "not a positive power of 2" } */
17 alignas (-1) int i; /* { dg-error "not a positive power of 2" } */
18 alignas (2 * 0 - 1) int j; /* { dg-error "not a positive power of 2" } */
21 template <int N> struct TNvalid1 { alignas (N) int i; };
23 template <int N> struct TNvalid2 { alignas (N) int i; };
24 TNvalid2<1 - 1> SNvalid2;
26 template <int N> struct TNinvalid1 { alignas (N) int i; }; /* { dg-error "not a positive power of 2" } */
27 TNinvalid1<-1> SNinvalid1;
28 template <int N> struct TNinvalid2 { alignas (N) int i; }; /* { dg-error "not a positive power of 2" } */
29 TNinvalid2<1 - 2> SNinvalid2;