blob: 0ddaabc8422574cdf6c678ce6cc3d3c59fd93863 [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s
Richard Smith9b362092013-03-09 23:56:02 +00002// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -fsyntax-only -verify %s
Richard Smith3e3a7052014-11-08 06:08:42 +00003// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++1z -fsyntax-only -verify %s
Douglas Gregor4d683662011-09-27 17:00:18 +00004
Seth Cantrell6255c252012-01-18 12:27:10 +00005int array0[u'ñ' == u'\xf1'? 1 : -1];
6int array1['\xF1' != u'\xf1'? 1 : -1];
7int array1['ñ' != u'\xf1'? 1 : -1]; // expected-error {{character too large for enclosing character literal type}}
Richard Smith3e3a7052014-11-08 06:08:42 +00008#if __cplusplus > 201402L
9char a = u8'ñ'; // expected-error {{character too large for enclosing character literal type}}
10char b = u8'\x80'; // ok
11char c = u8'\u0080'; // expected-error {{character too large for enclosing character literal type}}
12char d = u8'\u1234'; // expected-error {{character too large for enclosing character literal type}}
13char e = u8'ሴ'; // expected-error {{character too large for enclosing character literal type}}
14char f = u8'ab'; // expected-error {{Unicode character literals may not contain multiple characters}}
15#endif