diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-12-01 11:08:04 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-12-01 11:08:04 +0000 |
commit | 4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa (patch) | |
tree | 867cbbe32a66fd7d62dd9ce9df23a23fefdb8290 /test/SemaCXX/switch.cpp | |
parent | 6df2408694f81a03eb8b0e3b013272042233c061 (diff) | |
download | FreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.zip FreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.tar.gz |
Update clang to r90226.
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}} + } +} |