Fariborz Jahanian | ebfde17 | 2011-01-06 18:45:19 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fsyntax-only -Wno-deprecated -Wdeprecated-increment-bool -verify %s |
Douglas Gregor | 069a6da | 2011-03-14 16:13:32 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s |
Chandler Carruth | f3babb9 | 2011-04-23 06:54:44 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -fsyntax-only -Wno-write-strings -verify %s |
Richard Smith | e05372a | 2013-11-14 22:22:31 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -fsyntax-only -Werror=c++11-compat -verify %s -DERROR |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 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 |
Fariborz Jahanian | ebfde17 | 2011-01-06 18:45:19 +0000 | [diff] [blame] | 10 | // rdar://8827606 |
| 11 | |
| 12 | char *fun(void) |
| 13 | { |
| 14 | return "foo"; |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 15 | #if __cplusplus >= 201103L |
Richard Smith | e05372a | 2013-11-14 22:22:31 +0000 | [diff] [blame] | 16 | #ifdef ERROR |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 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}} |
Richard Smith | e05372a | 2013-11-14 22:22:31 +0000 | [diff] [blame] | 23 | #endif |
Fariborz Jahanian | ebfde17 | 2011-01-06 18:45:19 +0000 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | void test(bool b) |
| 27 | { |
| 28 | ++b; // expected-warning {{incrementing expression of type bool is deprecated}} |
| 29 | } |