aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-switch2.C
blob: 652a08d92bdc8ba1d85fd0164782c3dbd7a43e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test for constexpr conversion in case context
// { dg-do compile { target c++11 } }

enum class E { e1, e2 };

struct A
{
  E e;
  constexpr operator E() { return e; }
  constexpr A(E e): e(e) { }
};

E e;

int main()
{
  switch (e)
    {
    case A(E::e1):
    case A(E::e2):
      ;
    }
}