diff options
Diffstat (limited to 'test/SemaCXX/switch.cpp')
-rw-r--r-- | test/SemaCXX/switch.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp index b22adb7..003d5b8 100644 --- a/test/SemaCXX/switch.cpp +++ b/test/SemaCXX/switch.cpp @@ -13,3 +13,30 @@ void test() { break; } } + +// PR5518 +struct A { + operator int(); // expected-note{{conversion to integral type}} +}; + +void x() { + switch(A()) { + } +} + +enum E { e1, e2 }; +struct B : A { + operator E() const; // expected-note{{conversion to enumeration type}} +}; + +void x2() { + switch (B()) { // expected-error{{multiple conversions}} + } +} + +struct C; // expected-note{{forward declaration}} + +void x3(C &c) { + switch (c) { // expected-error{{incomplete class type}} + } +} |