diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
| commit | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (patch) | |
| tree | c72b9241553fc9966179aba84f90f17bfa9235c3 /test/SemaCXX/no-wchar.cpp | |
| parent | b52119637f743680a99710ce5fdb6646da2772af (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/no-wchar.cpp')
| -rw-r--r-- | test/SemaCXX/no-wchar.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/SemaCXX/no-wchar.cpp b/test/SemaCXX/no-wchar.cpp index b6dcddf1f428..040b46cdf5e5 100644 --- a/test/SemaCXX/no-wchar.cpp +++ b/test/SemaCXX/no-wchar.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -triple i386-pc-win32 -fsyntax-only -fno-wchar -verify %s +// RUN: %clang_cc1 -triple i386-pc-win32 -fsyntax-only -fno-wchar -verify -std=c++98 %s +// RUN: %clang_cc1 -triple i386-pc-win32 -fsyntax-only -fno-wchar -verify -std=c++11 %s wchar_t x; // expected-error {{unknown type name 'wchar_t'}} typedef unsigned short wchar_t; @@ -9,7 +11,11 @@ void bar() { } void foo1(wchar_t * t = L""); -// expected-warning@-1 {{conversion from string literal to 'wchar_t *' (aka 'unsigned short *') is deprecated}} +#if __cplusplus <= 199711L +// expected-warning@-2 {{conversion from string literal to 'wchar_t *' (aka 'unsigned short *') is deprecated}} +#else +// expected-warning@-4 {{ISO C++11 does not allow conversion from string literal to 'wchar_t *' (aka 'unsigned short *')}} +#endif short *a = L""; // expected-error@-1 {{cannot initialize a variable of type 'short *' with an lvalue of type 'const unsigned short [1]'}} |
