string-literal-encoding.c revision 91359302b822d829afa93c0dadf5f7ce6e19fbc6
1// RUN: %clang_cc1 -x c++ -std=c++0x -fsyntax-only -verify %s 2 3// This file should be encoded using ISO-8859-1, the string literals should 4// contain the ISO-8859-1 encoding for the code points U+00C0 U+00E9 U+00EE 5// U+00F5 U+00FC 6 7void f() { 8 wchar_t const *a = L"�����"; // expected-error {{illegal character encoding in string literal}} 9 10 char16_t const *b = u"�����"; // expected-error {{illegal character encoding in string literal}} 11 char32_t const *c = U"�����"; // expected-error {{illegal character encoding in string literal}} 12 wchar_t const *d = LR"(�����)"; // expected-error {{illegal character encoding in string literal}} 13 char16_t const *e = uR"(�����)"; // expected-error {{illegal character encoding in string literal}} 14 char32_t const *f = UR"(�����)"; // expected-error {{illegal character encoding in string literal}} 15 16 char const *g = "�����"; // expected-warning {{illegal character encoding in string literal}} 17 char const *h = u8"�����"; // expected-error {{illegal character encoding in string literal}} 18} 19