2019-07-30 04:00:46 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-signed-unsigned-wchar -verify=allow-signed %s
|
|
|
|
// allow-signed-no-diagnostics
|
2008-08-10 00:51:54 +08:00
|
|
|
wchar_t x;
|
|
|
|
|
|
|
|
void f(wchar_t p) {
|
|
|
|
wchar_t x;
|
2019-07-30 04:00:46 +08:00
|
|
|
unsigned wchar_t y; // expected-error {{'wchar_t' cannot be signed or unsigned}}
|
|
|
|
signed wchar_t z; // expected-error {{'wchar_t' cannot be signed or unsigned}}
|
2008-08-17 21:24:01 +08:00
|
|
|
++x;
|
2008-08-10 00:51:54 +08:00
|
|
|
}
|
2009-07-06 07:44:27 +08:00
|
|
|
|
|
|
|
// PR4502
|
|
|
|
wchar_t const c = L'c';
|
|
|
|
int a[c == L'c' ? 1 : -1];
|
2009-12-31 05:19:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
// PR5917
|
|
|
|
template<typename _CharT>
|
|
|
|
struct basic_string {
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename _CharT>
|
|
|
|
basic_string<_CharT> operator+ (const basic_string<_CharT>&, _CharT);
|
|
|
|
|
|
|
|
int t(void) {
|
|
|
|
basic_string<wchar_t>() + L'-';
|
|
|
|
return (0);
|
|
|
|
}
|
2010-06-16 02:06:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
// rdar://8040728
|
|
|
|
wchar_t in[] = L"\x434" "\x434"; // No warning
|
|
|
|
|