[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Lexer / char-literal-encoding-error.c
blobe752de2920e5e62d7b5731a0c112105104bf8ee5
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -x c++ %s
3 // This file is encoded using ISO-8859-1
5 int main() {
6 (void)'é'; // expected-warning {{illegal character encoding in character literal}}
7 (void)u'é'; // expected-error {{illegal character encoding in character literal}}
8 (void)U'é'; // expected-error {{illegal character encoding in character literal}}
9 (void)L'é'; // expected-error {{illegal character encoding in character literal}}
11 // For narrow character literals, since there is no error, make sure the
12 // encoding is correct
13 static_assert((unsigned char)'é' == 0xE9, ""); // expected-warning {{illegal character encoding in character literal}}
14 static_assert('éé' == 0xE9E9, ""); // expected-warning {{illegal character encoding in character literal}} expected-warning {{multi-character character constant}}