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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// Test for constexpr conversion in case context
2
// { dg-options -std=c++0x }
3
 
4
enum class E { e1, e2 };
5
 
6
struct A
7
{
8
  E e;
9
  constexpr operator E() { return e; }
10
  constexpr A(E e): e(e) { }
11
};
12
 
13
E e;
14
 
15
int main()
16
{
17
  switch (e)
18
    {
19
    case A(E::e1):
20
    case A(E::e2):
21
      ;
22
    }
23
}

powered by: WebSVN 2.1.0

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