• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -verify -std=c++11 %s
2 
3 char c00 = '\u0000'; // ok
4 char c01 = '\u0001'; // ok
5 char c1f = '\u001f'; // ok
6 char c20 = '\u0020'; // ' ', ok
7 char c22 = '\u0022'; // ", ok
8 char c23 = '\u0023'; // #, ok
9 char c24 = '\u0024'; // $, ok
10 char c25 = '\u0025'; // %, ok
11 char c27 = '\u0027'; // ', ok
12 char c3f = '\u003f'; // ?, ok
13 char c40 = '\u0040'; // @, ok
14 char c41 = '\u0041'; // A, ok
15 char c5f = '\u005f'; // _, ok
16 char c60 = '\u0060'; // `, ok
17 char c7e = '\u007e'; // ~, ok
18 char c7f = '\u007f'; // ok
19 
20 wchar_t w007f = L'\u007f';
21 wchar_t w0080 = L'\u0080';
22 wchar_t w009f = L'\u009f';
23 wchar_t w00a0 = L'\u00a0';
24 
25 wchar_t wd799 = L'\ud799';
26 wchar_t wd800 = L'\ud800'; // expected-error {{invalid universal character}}
27 wchar_t wdfff = L'\udfff'; // expected-error {{invalid universal character}}
28 wchar_t we000 = L'\ue000';
29 
30 char32_t w10fffe = U'\U0010fffe';
31 char32_t w10ffff = U'\U0010ffff';
32 char32_t w110000 = U'\U00110000'; // expected-error {{invalid universal character}}
33 
34 const char *p1 = "\u0000\u0001\u001f\u0020\u0022\u0023\u0024\u0025\u0027\u003f\u0040\u0041\u005f\u0060\u007e\u007f";
35 const wchar_t *p2 = L"\u0000\u0012\u004e\u007f\u0080\u009f\u00a0\ud799\ue000";
36 const char *p3 = u8"\u0000\u0012\u004e\u007f\u0080\u009f\u00a0\ud799\ue000";
37 const char16_t *p4 = u"\u0000\u0012\u004e\u007f\u0080\u009f\u00a0\ud799\ue000";
38 const char32_t *p5 = U"\u0000\u0012\u004e\u007f\u0080\u009f\u00a0\ud799\ue000";
39 const wchar_t *p6 = L"foo \U00110000 bar"; // expected-error {{invalid universal character}}
40 const char *p7 = u8"foo \U0000d800 bar"; // expected-error {{invalid universal character}}
41 const char16_t *p8 = u"foo \U0000dfff bar"; // expected-error {{invalid universal character}}
42 const char32_t *p9 = U"foo \U0010ffff bar"; // ok
43