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