blob: 5b667208ed1bbb7aefff50f2c36c2e96fc95f5e9 [file] [log] [blame]
// PR c++/49136
// { dg-do compile { target c++11 } }
struct day
{
unsigned d : 5;
unsigned n : 3;
constexpr explicit day (int dd) : d(dd), n(7) {}
};
struct date {
int d;
constexpr date (day dd) : d(dd.n != 7 ? 7 : dd.d) {}
};
constexpr day d(0);
constexpr date dt(d);
static_assert (dt.d == 0, "Error");