1 // PR c++/49136 2 // { dg-do compile { target c++11 } } 3 4 struct S 5 { 6 unsigned : 1; unsigned s : 27; unsigned : 4; SS7 constexpr S (unsigned int x) : s(x) {} 8 }; 9 10 template <typename S> 11 struct T 12 { 13 unsigned int t; TT14 constexpr T (S s) : t(s.s != 7 ? 0 : s.s) {} TT15 constexpr T (S s, S s2) : t(s.s != s2.s ? 0 : s.s) {} 16 }; 17 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"); 22 23 struct U 24 { 25 int a : 1; int s : 1; UU26 constexpr U (int x, int y) : a (x), s (y) {} 27 }; 28 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"); 33