aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-54.C
blob: 45aa8e4758f7b0e93ee1cbbd1ea0ca03c5fe9f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR c++/56859
// { dg-require-effective-target c++11 }

template<unsigned size, unsigned alignment>
struct aligned_storage
{
  using type = struct { alignas(alignment) unsigned char data[size]; };
};

#define SA(X) static_assert((X),#X)
SA(alignof(aligned_storage<8,1>::type) == 1);
SA(alignof(aligned_storage<8,2>::type) == 2);
SA(alignof(aligned_storage<8,4>::type) == 4);
SA(alignof(aligned_storage<8,8>::type) == 8);