]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/constexpr-switch2.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-switch2.C
1 // Test for constexpr conversion in case context
2 // { dg-do compile { target c++11 } }
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 }
This page took 0.03989 seconds and 5 git commands to generate.