summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/__config14
-rw-r--r--libcxx/include/type_traits4
-rw-r--r--libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp5
-rw-r--r--libcxxabi/test/unwind_06.pass.cpp16
4 files changed, 31 insertions, 8 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index ee7351e9313..1ae2fdc7b81 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -963,6 +963,20 @@ typedef unsigned int char32_t;
# define _LIBCPP_DEPRECATED_IN_CXX17
#endif
+// Macros to enter and leave a state where deprecation warnings are suppressed.
+#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
+ (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))
+# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated\"")
+# define _LIBCPP_SUPPRESS_DEPRECATED_POP \
+ _Pragma("GCC diagnostic pop")
+#endif
+#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH)
+# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+# define _LIBCPP_SUPPRESS_DEPRECATED_POP
+#endif
+
#if _LIBCPP_STD_VER <= 11
# define _LIBCPP_EXPLICIT_AFTER_CXX11
#else
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 77dcc2321d9..77b57a41e41 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -1119,8 +1119,12 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
#endif
+// Suppress deprecation notice for volatile-qualified return type resulting
+// from volatile-qualified types _Tp.
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
template <class _Tp> _Tp&& __declval(int);
template <class _Tp> _Tp __declval(long);
+_LIBCPP_SUPPRESS_DEPRECATED_POP
template <class _Tp>
decltype(_VSTD::__declval<_Tp>(0))
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
index 2128590047d..595989c4f3f 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
@@ -55,6 +55,9 @@ void test_result_of_imp()
#endif
}
+// Do not warn on deprecated uses of 'volatile' below.
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
+
int main(int, char**)
{
{
@@ -171,3 +174,5 @@ int main(int, char**)
return 0;
}
+
+_LIBCPP_SUPPRESS_DEPRECATED_POP
diff --git a/libcxxabi/test/unwind_06.pass.cpp b/libcxxabi/test/unwind_06.pass.cpp
index e4c04e83745..7d67f52f8e0 100644
--- a/libcxxabi/test/unwind_06.pass.cpp
+++ b/libcxxabi/test/unwind_06.pass.cpp
@@ -24,7 +24,7 @@ volatile int counter;
double try1(bool v) {
double a = get(0);
double b = get(1);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b;
if (v) throw 10;
return get(0)+a+b;
@@ -34,7 +34,7 @@ double try2(bool v) {
double a = get(0);
double b = get(1);
double c = get(2);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b + c;
if (v) throw 10;
return get(0)+a+b+c;
@@ -45,7 +45,7 @@ double try3(bool v) {
double b = get(1);
double c = get(2);
double d = get(3);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b + c + d;
if (v) throw 10;
return get(0)+a+b+c+d;
@@ -57,7 +57,7 @@ double try4(bool v) {
double c = get(0);
double d = get(0);
double e = get(0);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b+c+d+e;
if (v) throw 10;
return get(0)+a+b+c+d+e;
@@ -70,7 +70,7 @@ double try5(bool v) {
double d = get(0);
double e = get(0);
double f = get(0);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b+c+d+e+f;
if (v) throw 10;
return get(0)+a+b+c+d+e+f;
@@ -84,7 +84,7 @@ double try6(bool v) {
double e = get(0);
double f = get(0);
double g = get(0);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b+c+d+e+f+g;
if (v) throw 10;
return get(0)+a+b+c+d+e+f+g;
@@ -99,7 +99,7 @@ double try7(bool v) {
double f = get(0);
double g = get(0);
double h = get(0);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b+c+d+e+f+g+h;
if (v) throw 10;
return get(0)+a+b+c+d+e+f+g+h;
@@ -115,7 +115,7 @@ double try8(bool v) {
double g = get(0);
double h = get(0);
double i = get(0);
- for (counter = 100; counter; --counter)
+ for (counter = 100; counter; counter = counter - 1)
a += get(1) + b+c+d+e+f+g+h+i;
if (v) throw 10;
return get(0)+a+b+c+d+e+f+g+h+i;
OpenPOWER on IntegriCloud