* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / alignas5.C
blob2dcc41fae8a00c881421aba62414090a7159c660
1 // PR c++/58109  - alignas() fails to compile with constant expression
2 // { dg-do compile }
4 template <typename T>
5 struct Base {
6   static const int Align = sizeof (T);
7 };
9 // Never instantiated.
10 template <typename T>
11 struct Derived: Base<T>
13 #if __cplusplus >= 201102L
14   // This is the meat of the (simplified) regression test for c++/58109.
15   using B = Base<T>;
16   using B::Align;
18   alignas (Align) char a [1];
19   alignas (Align) T b [1];
20 #else
21   // Fake the test for C++ 98.
22 #  define Align Base<T>::Align
23 #endif
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.
30 template <typename T>
31 struct InstDerived: Base<T>
33 #if __cplusplus >= 201102L
34   using B = Base<T>;
35   using B::Align;
37   alignas (Align) char a [1];
38   alignas (Align) T b [1];
39 #endif
41   char __attribute__ ((aligned (Align))) c [1];
42   T __attribute__ ((aligned (Align))) d [1];
45 InstDerived<int> dx;