OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-bitfield2.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/49136
2
// { dg-do compile }
3
// { dg-options "-std=c++0x" }
4
 
5
struct day
6
{
7
  unsigned d : 5;
8
  unsigned n : 3;
9
  constexpr explicit day (int dd) : d(dd), n(7) {}
10
};
11
 
12
struct date {
13
  int d;
14
  constexpr date (day dd) : d(dd.n != 7 ? 7 : dd.d) {}
15
};
16
 
17
constexpr day d(0);
18
constexpr date dt(d);
19
static_assert (dt.d == 0, "Error");

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.