2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / alias-decl-attr2.C
blob6437212fb17698a18297588a2a6d9d5c5309aaf7
1 // { dg-do compile { target c++11 } }
3 template<typename T>
4 struct X {
5     using layout_type __attribute ((aligned(__alignof(double)))) =
6         char[sizeof(T)];
7     layout_type data;
8 };
10 template<typename T>
11 struct Y {
12     using layout_type  __attribute ((aligned(__alignof(T)))) =
13         char[sizeof(T)];
14     layout_type data;
17 template<typename T>
18 struct Z {
19     using layout_type __attribute ((aligned(__alignof(T)))) =
20         char[sizeof(T)];
21     struct Z2 {
22         layout_type data;
23     } in;
26 template<typename T>
27 struct A;
29 template <typename T>
30 struct A<T*> {
31     using layout_type __attribute ((aligned(__alignof(T)))) =
32         char[sizeof(T)];
33   layout_type data;
36 template<bool> struct StaticAssert;
37 template<> struct StaticAssert<true> {};
39 StaticAssert<__alignof(X<double>) == __alignof(double)> d1;
40 StaticAssert<__alignof(Y<double>) == __alignof(double)> d2;
41 StaticAssert<__alignof(Z<double>) == __alignof(double)> d3;
42 StaticAssert<__alignof(A<double*>) == __alignof(double)> d4;