summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/writable-strings-deprecated.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-04-22 01:11:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-04-22 01:11:06 +0000
commite334c017737de0a1127a5cd70e99df198f9227b1 (patch)
treef26724d88c25535998fec5b5a293a2b4fc7f537f /clang/test/SemaCXX/writable-strings-deprecated.cpp
parent393197a08e2b8376c4f5304c7eeaa84eecdf27cf (diff)
downloadbcm5719-llvm-e334c017737de0a1127a5cd70e99df198f9227b1.tar.gz
bcm5719-llvm-e334c017737de0a1127a5cd70e99df198f9227b1.zip
Move the C++11 ExtWarn for converting a string literal to 'char*' out of
-Wc++11-compat-deprecated-writable-strings. It's neither a C++11 compatibility warning nor a deprecated feature, it's just ill-formed. In passing, add that warning to -Wdeprecated, where it belongs. llvm-svn: 206833
Diffstat (limited to 'clang/test/SemaCXX/writable-strings-deprecated.cpp')
-rw-r--r--clang/test/SemaCXX/writable-strings-deprecated.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/writable-strings-deprecated.cpp b/clang/test/SemaCXX/writable-strings-deprecated.cpp
index b8f605b63d6..f9258334980 100644
--- a/clang/test/SemaCXX/writable-strings-deprecated.cpp
+++ b/clang/test/SemaCXX/writable-strings-deprecated.cpp
@@ -1,14 +1,25 @@
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated -Wdeprecated-increment-bool -verify %s
// RUN: %clang_cc1 -fsyntax-only -fwritable-strings -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wno-write-strings -verify %s
// RUN: %clang_cc1 -fsyntax-only -Werror=c++11-compat -verify %s -DERROR
+// 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
// rdar://8827606
char *fun(void)
{
return "foo";
+#if __cplusplus >= 201103L
#ifdef ERROR
- // expected-error@-2 {{deprecated}}
+ // 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}}
#endif
}
OpenPOWER on IntegriCloud