diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-23 13:46:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-23 13:46:08 +0000 |
commit | 84fb9c0be621c9e4ca4e56f67dae2a0bb6e44821 (patch) | |
tree | 0d9de76502097609f06f328d39c932497307aeef /test/FixIt/fixit-cxx0x.cpp | |
parent | 74295b3408178bd0e97c2090dac911817778b582 (diff) |
Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt/fixit-cxx0x.cpp')
-rw-r--r-- | test/FixIt/fixit-cxx0x.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp new file mode 100644 index 0000000000..2c783bc2e3 --- /dev/null +++ b/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}} + } +} + |