From 53afad5ebbfd47e932405af5b93177ea0d68e3f4 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 29 Jul 2011 01:08:54 +0000 Subject: 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 --- test/SemaCXX/cxx0x-type-convert-construct.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/SemaCXX/cxx0x-type-convert-construct.cpp (limited to 'test/SemaCXX/cxx0x-type-convert-construct.cpp') 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]'}} +} -- cgit v1.2.3-70-g09d2