2011-01-07 02:45:19 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
|
2014-04-22 09:11:06 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated -Wdeprecated-increment-bool -verify %s
|
2011-03-15 00:13:32 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s
|
2011-04-23 14:54:44 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-write-strings -verify %s
|
2013-11-15 06:22:31 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Werror=c++11-compat -verify %s -DERROR
|
2014-04-22 09:11:06 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Werror=deprecated -Wno-error=deprecated-increment-bool -verify %s -DERROR
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -Wno-deprecated -Wdeprecated-increment-bool
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -pedantic-errors -DERROR
|
2011-01-07 02:45:19 +08:00
|
|
|
// rdar://8827606
|
|
|
|
|
|
|
|
char *fun(void)
|
|
|
|
{
|
|
|
|
return "foo";
|
2014-04-22 09:11:06 +08:00
|
|
|
#if __cplusplus >= 201103L
|
2013-11-15 06:22:31 +08:00
|
|
|
#ifdef ERROR
|
2014-04-22 09:11:06 +08:00
|
|
|
// expected-error@-3 {{ISO C++11 does not allow conversion from string literal to 'char *'}}
|
|
|
|
#else
|
|
|
|
// expected-warning@-5 {{ISO C++11 does not allow conversion from string literal to 'char *'}}
|
|
|
|
#endif
|
|
|
|
#elif defined(ERROR)
|
|
|
|
// expected-error@-8 {{deprecated}}
|
2013-11-15 06:22:31 +08:00
|
|
|
#endif
|
2011-01-07 02:45:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void test(bool b)
|
|
|
|
{
|
|
|
|
++b; // expected-warning {{incrementing expression of type bool is deprecated}}
|
|
|
|
}
|