summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-switch2.C
blob: 55cf2ad7ce8467677dafb9ea0ecbb1c9ff6cf0bc (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-options -std=c++0x }

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):
      ;
    }
}