1 // RUN: %clang_cc1 -verify -std=c++98 %s 2 3 char c00 = '\u0000'; // expected-error {{universal character name refers to a control character}} 4 char c01 = '\u0001'; // expected-error {{universal character name refers to a control character}} 5 char c1f = '\u001f'; // expected-error {{universal character name refers to a control character}} 6 char c20 = '\u0020'; // ' ', expected-error {{character ' ' cannot be specified by a universal character name}} 7 char c22 = '\u0022'; // ", expected-error {{character '"' cannot be specified by a universal character name}} 8 char c23 = '\u0023'; // #, expected-error {{character '#' cannot be specified by a universal character name}} 9 char c24 = '\u0024'; // $, ok 10 char c25 = '\u0025'; // %, expected-error {{character '%' cannot be specified by a universal character name}} 11 char c27 = '\u0027'; // ', expected-error {{character ''' cannot be specified by a universal character name}} 12 char c3f = '\u003f'; // ?, expected-error {{character '?' cannot be specified by a universal character name}} 13 char c40 = '\u0040'; // @, ok 14 char c41 = '\u0041'; // A, expected-error {{character 'A' cannot be specified by a universal character name}} 15 char c5f = '\u005f'; // _, expected-error {{character '_' cannot be specified by a universal character name}} 16 char c60 = '\u0060'; // `, ok 17 char c7e = '\u007e'; // ~, expected-error {{character '~' cannot be specified by a universal character name}} 18 char c7f = '\u007f'; // expected-error {{universal character name refers to a control character}} 19 20 wchar_t w007f = L'\u007f'; // expected-error {{universal character name refers to a control character}} 21 wchar_t w0080 = L'\u0080'; // expected-error {{universal character name refers to a control character}} 22 wchar_t w009f = L'\u009f'; // expected-error {{universal character name refers to a control character}} 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 const char *s00 = "\u0000"; // expected-error {{universal character name refers to a control character}} 31 const char *s01 = "\u0001"; // expected-error {{universal character name refers to a control character}} 32 const char *s1f = "\u001f"; // expected-error {{universal character name refers to a control character}} 33 const char *s20 = "\u0020"; // ' ', expected-error {{character ' ' cannot be specified by a universal character name}} 34 const char *s22 = "\u0022"; // ", expected-error {{character '"' cannot be specified by a universal character name}} 35 const char *s23 = "\u0023"; // #, expected-error {{character '#' cannot be specified by a universal character name}} 36 const char *s24 = "\u0024"; // $, ok 37 const char *s25 = "\u0025"; // %, expected-error {{character '%' cannot be specified by a universal character name}} 38 const char *s27 = "\u0027"; // ', expected-error {{character ''' cannot be specified by a universal character name}} 39 const char *s3f = "\u003f"; // ?, expected-error {{character '?' cannot be specified by a universal character name}} 40 const char *s40 = "\u0040"; // @, ok 41 const char *s41 = "\u0041"; // A, expected-error {{character 'A' cannot be specified by a universal character name}} 42 const char *s5f = "\u005f"; // _, expected-error {{character '_' cannot be specified by a universal character name}} 43 const char *s60 = "\u0060"; // `, ok 44 const char *s7e = "\u007e"; // ~, expected-error {{character '~' cannot be specified by a universal character name}} 45 const char *s7f = "\u007f"; // expected-error {{universal character name refers to a control character}} 46 47 const wchar_t *ws007f = L"\u007f"; // expected-error {{universal character name refers to a control character}} 48 const wchar_t *ws0080 = L"\u0080"; // expected-error {{universal character name refers to a control character}} 49 const wchar_t *ws009f = L"\u009f"; // expected-error {{universal character name refers to a control character}} 50 const wchar_t *ws00a0 = L"\u00a0"; 51 52 const wchar_t *wsd799 = L"\ud799"; 53 const wchar_t *wsd800 = L"\ud800"; // expected-error {{invalid universal character}} 54 const wchar_t *wsdfff = L"\udfff"; // expected-error {{invalid universal character}} 55 const wchar_t *wse000 = L"\ue000"; 56