aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx0x-type-convert-construct.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-29 01:08:54 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-29 01:08:54 +0000
commit53afad5ebbfd47e932405af5b93177ea0d68e3f4 (patch)
tree41f62f76b8462e6942b4d4600086bf870bd96a99 /test/SemaCXX/cxx0x-type-convert-construct.cpp
parenteda61584120f59a35d4493b0af4bed717494e826 (diff)
This patch makes the string/character literal tests run in C,
C++98/03, and C++0x mode, from Craig Topper! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-type-convert-construct.cpp')
-rw-r--r--test/SemaCXX/cxx0x-type-convert-construct.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-type-convert-construct.cpp b/test/SemaCXX/cxx0x-type-convert-construct.cpp
new file mode 100644
index 0000000000..a523108c6e
--- /dev/null
+++ b/test/SemaCXX/cxx0x-type-convert-construct.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=gnu++0x -fsyntax-only -verify %s
+
+void f() {
+ char *u8str;
+ u8str = u8"a UTF-8 string"; // expected-error {{assigning to 'char *' from incompatible type 'const char [15]'}}
+ char16_t *ustr;
+ ustr = u"a UTF-16 string"; // expected-error {{assigning to 'char16_t *' from incompatible type 'const char16_t [16]'}}
+ char32_t *Ustr;
+ Ustr = U"a UTF-32 string"; // expected-error {{assigning to 'char32_t *' from incompatible type 'const char32_t [16]'}}
+}