[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / SemaCXX / writable-strings-deprecated.cpp
blob7de11b59dd11dcd0fd9d7d754841f3db73b3c844
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -DWARNING
2 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s -DWARNING
3 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wno-deprecated-writable-strings -verify %s
4 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wno-deprecated -Wdeprecated-increment-bool -verify %s
5 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -fwritable-strings -verify %s
6 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wno-write-strings -verify %s
7 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Werror=c++11-compat -verify %s -DERROR
8 // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Werror=deprecated -Wno-error=deprecated-increment-bool -verify %s -DERROR
9 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -DWARNING
10 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -Wno-deprecated -Wdeprecated-increment-bool -DWARNING
11 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -pedantic-errors -DERROR
12 // rdar://8827606
14 char *fun(void)
16 return "foo";
17 #if defined(ERROR)
18 #if __cplusplus >= 201103L
19 // expected-error@-3 {{ISO C++11 does not allow conversion from string literal to 'char *'}}
20 #else
21 // expected-error@-5 {{conversion from string literal to 'char *' is deprecated}}
22 #endif
23 #elif defined(WARNING)
24 #if __cplusplus >= 201103L
25 // expected-warning@-9 {{ISO C++11 does not allow conversion from string literal to 'char *'}}
26 #else
27 // expected-warning@-11 {{conversion from string literal to 'char *' is deprecated}}
28 #endif
29 #endif
32 void test(bool b)
34 ++b; // expected-warning {{incrementing expression of type bool is deprecated}}