c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / gen-attrs-50.C
blob2479dfdf19c13b8b1c58d246e8ffb5cab5f1118d
1 // { dg-do compile { target c++11 } }
3 typedef char layout_type;
5 template<class> struct A {
6   layout_type member alignas (double) alignas (int);
7 };
9 // Here, the spec says that A<int> should have the stricter alignment,
10 // so that would be the alignment of 'double', not 'int'.
11 static_assert (alignof (A<int>) == alignof (double),
12                "alignment of struct A must be alignof (double)");
14 template<class> struct alignas (1) alignas (alignof (long double)) B {
15   layout_type member;
18 // Similarly, the B<int> should have the stricter alignment, so that would
19 // so that would be the alignment of 'long double', not '1'.
20 static_assert (alignof (B<int>) == alignof (long double),
21                "alignment of struct A must be alignof (double double)");