2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / gen-attrs-17.2.C
blob636f9a9ac8bd2535a7d5973ba34a0bb64d0478b9
1 // { dg-do compile { target c++11 } }
2 // Origin: Benjamin Kosnik <bkoz at gcc dot gnu dot org>
3 // PR c++/17743: Attributes applied to typedefs.
5 struct A {
6   typedef char layout_type[sizeof(double)]
7   [[gnu::aligned(alignof(double)]]); // { dg-error "expected" }
8   layout_type data;
9 };
11 struct B {
12   typedef char layout_type[sizeof(double)];
13   layout_type data  [[gnu::aligned(alignof(double))]];
16 template<bool> struct StaticAssert;
17 template<> struct StaticAssert<true> {};
19 StaticAssert<alignof(A) == alignof(B)> a1;// { dg-error "incomplete type and cannot be defined" }