PR c++/85553
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-switch2.C
blob652a08d92bdc8ba1d85fd0164782c3dbd7a43e5c
1 // Test for constexpr conversion in case context
2 // { dg-do compile { target c++11 } }
4 enum class E { e1, e2 };
6 struct A
8   E e;
9   constexpr operator E() { return e; }
10   constexpr A(E e): e(e) { }
13 E e;
15 int main()
17   switch (e)
18     {
19     case A(E::e1):
20     case A(E::e2):
21       ;
22     }