Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify -std=c++0x %s |
| 2 | // RUN: cp %s %t |
| 3 | // RUN: %clang_cc1 -std=c++0x -fixit %t || true |
| 4 | // RUN: %clang_cc1 -Wall -pedantic -x c++ -std=c++0x %t |
Douglas Gregor | 84fb9c0 | 2009-11-23 13:46:08 +0000 | [diff] [blame] | 5 | |
| 6 | /* This is a test of the various code modification hints that only |
| 7 | apply in C++0x. */ |
Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 8 | struct A { |
Douglas Gregor | 84fb9c0 | 2009-11-23 13:46:08 +0000 | [diff] [blame] | 9 | explicit operator int(); // expected-note{{conversion to integral type}} |
| 10 | }; |
| 11 | |
Nick Lewycky | ba5f6ec | 2010-04-24 01:30:46 +0000 | [diff] [blame] | 12 | void x() { |
Douglas Gregor | 84fb9c0 | 2009-11-23 13:46:08 +0000 | [diff] [blame] | 13 | switch(A()) { // expected-error{{explicit conversion to}} |
| 14 | } |
| 15 | } |
| 16 | |