repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
constexpr-bitfield2.C
blob
5b667208ed1bbb7aefff50f2c36c2e96fc95f5e9
1
// PR c++/49136
2
// { dg-do compile { target c++11 } }
3
4
struct day
5
{
6
unsigned d : 5;
7
unsigned n : 3;
8
constexpr explicit day (int dd) : d(dd), n(7) {}
9
};
10
11
struct date {
12
int d;
13
constexpr date (day dd) : d(dd.n != 7 ? 7 : dd.d) {}
14
};
15
16
constexpr day d(0);
17
constexpr date dt(d);
18
static_assert (dt.d == 0, "Error");