Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/alignas22.C

raw
1 // PR c++/118787
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-pedantic" }
4
5 template <typename T, int N>
6 void foo (T & alignas (N)); // { dg-warning "'alignas' on a type other than class" }
7 template <typename T, int N>
8 void bar (T (&)[N] alignas (N)); // { dg-warning "'alignas' on a type other than class" }
9 template <typename T, int N>
10 using U = T * alignas (N); // { dg-warning "'alignas' on a type other than class" }
11 template <typename T, int N>
12 using V = T[N] alignas (N); // { dg-warning "'alignas' on a type other than class" }
13
14 void
15 baz ()
16 {
17 int x alignas (4) = 0;
18 foo <int, 4> (x);
19 int y alignas (4) [4];
20 bar <int, 4> (y);
21 U <int, 4> u;
22 V <int, 4> v;
23 }