1 // PR c++/58109 - alignas() fails to compile with constant expression
6 static const int Align = sizeof (T);
11 struct Derived: Base<T>
13 #if __cplusplus >= 201102L
14 // This is the meat of the (simplified) regression test for c++/58109.
18 alignas (Align) char a [1];
19 alignas (Align) T b [1];
21 // Fake the test for C++ 98.
22 # define Align Base<T>::Align
25 char __attribute__ ((aligned (Align))) c [1];
26 T __attribute__ ((aligned (Align))) d [1];
29 // Instantiated to verify that the code is accepted even when instantiated.
31 struct InstDerived: Base<T>
33 #if __cplusplus >= 201102L
37 alignas (Align) char a [1];
38 alignas (Align) T b [1];
41 char __attribute__ ((aligned (Align))) c [1];
42 T __attribute__ ((aligned (Align))) d [1];