* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-bitfield3.C
blobc393db4e6e9f68f4cbfc9d8d63242826540293f4
1 // PR c++/49136
2 // { dg-do compile { target c++11 } }
4 struct S
6   unsigned : 1; unsigned s : 27; unsigned : 4;
7   constexpr S (unsigned int x) : s(x) {}
8 };
10 template <typename S>
11 struct T
13   unsigned int t;
14   constexpr T (S s) : t(s.s != 7 ? 0 : s.s) {}
15   constexpr T (S s, S s2) : t(s.s != s2.s ? 0 : s.s) {}
18 constexpr S s (7), s2 (7);
19 constexpr T<S> t (s), t2 (s, s2);
20 static_assert (t.t == 7, "Error");
21 static_assert (t2.t == 7, "Error");
23 struct U
25   int a : 1; int s : 1;
26   constexpr U (int x, int y) : a (x), s (y) {}
29 constexpr U u (0, -1), u2 (-1, -1);
30 constexpr T<U> t3 (u), t4 (u, u2);
31 static_assert (t3.t == 0, "Error");
32 static_assert (t4.t == -1, "Error");