blob: f9258334980b87e73fcc6332526fb6cff57728aa [file] [log] [blame]
Fariborz Jahanianebfde172011-01-06 18:45:19 +00001// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
Stephen Hines6bcf27b2014-05-29 04:14:42 -07002// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated -Wdeprecated-increment-bool -verify %s
Douglas Gregor069a6da2011-03-14 16:13:32 +00003// RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s
Chandler Carruthf3babb92011-04-23 06:54:44 +00004// RUN: %clang_cc1 -fsyntax-only -Wno-write-strings -verify %s
Richard Smithe05372a2013-11-14 22:22:31 +00005// RUN: %clang_cc1 -fsyntax-only -Werror=c++11-compat -verify %s -DERROR
Stephen Hines6bcf27b2014-05-29 04:14:42 -07006// 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 Jahanianebfde172011-01-06 18:45:19 +000010// rdar://8827606
11
12char *fun(void)
13{
14 return "foo";
Stephen Hines6bcf27b2014-05-29 04:14:42 -070015#if __cplusplus >= 201103L
Richard Smithe05372a2013-11-14 22:22:31 +000016#ifdef ERROR
Stephen Hines6bcf27b2014-05-29 04:14:42 -070017 // 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 Smithe05372a2013-11-14 22:22:31 +000023#endif
Fariborz Jahanianebfde172011-01-06 18:45:19 +000024}
25
26void test(bool b)
27{
28 ++b; // expected-warning {{incrementing expression of type bool is deprecated}}
29}