aboutsummaryrefslogtreecommitdiff
path: root/test/Lexer/string-literal-encoding.c
blob: aa7cb73f6267eda89993b026124ebd153d5d48c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_cc1 -x c++ -std=c++0x -fsyntax-only -verify %s

// This file should be encoded using ISO-8859-1, the string literals should
// contain the ISO-8859-1 encoding for the code points U+00C0 U+00E9 U+00EE
// U+00F5 U+00FC

void f() {
    wchar_t const *a = L"�����"; // expected-error {{illegal character encoding in string literal}}

    char16_t const *b = u"�����"; // expected-error {{illegal character encoding in string literal}}
    char32_t const *c = U"�����"; // expected-error {{illegal character encoding in string literal}}
    wchar_t const *d = LR"(�����)"; // expected-error {{illegal character encoding in string literal}}
    char16_t const *e = uR"(�����)"; // expected-error {{illegal character encoding in string literal}}
    char32_t const *f = UR"(�����)"; // expected-error {{illegal character encoding in string literal}}

    char const *g = "�����"; // expected-warning {{illegal character encoding in string literal}}
    char const *h = u8"�����"; // expected-error {{illegal character encoding in string literal}}
}