summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/fixit-cxx0x.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-23 13:46:08 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-23 13:46:08 +0000
commitd0c22e0d10fc9e7df2a8fa1431d0c5eb5c5bd341 (patch)
tree8198dbe0cf535e178fa25a48d4cbdb720ed7705d /clang/test/FixIt/fixit-cxx0x.cpp
parentbd866c2985f0a5da3e7fbf9e7c7ca4b6f0c37c9a (diff)
downloadbcm5719-llvm-d0c22e0d10fc9e7df2a8fa1431d0c5eb5c5bd341.tar.gz
bcm5719-llvm-d0c22e0d10fc9e7df2a8fa1431d0c5eb5c5bd341.zip
Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518. llvm-svn: 89655
Diffstat (limited to 'clang/test/FixIt/fixit-cxx0x.cpp')
-rw-r--r--clang/test/FixIt/fixit-cxx0x.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit-cxx0x.cpp b/clang/test/FixIt/fixit-cxx0x.cpp
new file mode 100644
index 00000000000..2c783bc2e33
--- /dev/null
+++ b/clang/test/FixIt/fixit-cxx0x.cpp
@@ -0,0 +1,14 @@
+/* RUN: clang-cc -std=c++0x -fixit %s -o - | clang-cc -x c++ -std=c++0x -
+ */
+
+/* This is a test of the various code modification hints that only
+ apply in C++0x. */
+struct A {
+ explicit operator int(); // expected-note{{conversion to integral type}}
+};
+
+void x() {
+ switch(A()) { // expected-error{{explicit conversion to}}
+ }
+}
+
OpenPOWER on IntegriCloud