From 95edead9aab7a70636f87ea041f05469dc41d9a9 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 31 Jul 2020 17:51:00 +0100 Subject: [PATCH] libstdc++: Add -Wno-deprecated for tests that warn in C++20 libstdc++-v3/ChangeLog: * testsuite/20_util/tuple/78939.cc: Suppress warnings about deprecation of volatile-qualified structured bindings in C++20. * testsuite/20_util/variable_templates_for_traits.cc: Likewise for deprecation of is_pod in C++20 --- libstdc++-v3/testsuite/20_util/tuple/78939.cc | 5 +++-- libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/tuple/78939.cc b/libstdc++-v3/testsuite/20_util/tuple/78939.cc index d238f75..b2ff324 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/78939.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/78939.cc @@ -16,6 +16,7 @@ // . // { dg-options "-std=gnu++17" } +// { dg-additional-options "-Wno-deprecated" { target c++2a } } // { dg-do compile { target c++17 } } // PR libstdc++/78939 @@ -36,7 +37,7 @@ int test02() { A a{}; - volatile auto [i, j] = a; + volatile auto [i, j] = a; // deprecated in C++20 return i + j; } @@ -44,6 +45,6 @@ int test03() { A a{}; - const volatile auto [i, j] = a; + const volatile auto [i, j] = a; // deprecated in C++20 return i + j; } diff --git a/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc b/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc index 0f1625a..9c1f82b 100644 --- a/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc +++ b/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc @@ -1,5 +1,6 @@ // { dg-options "-std=gnu++17" } -// { dg-do compile } +// { dg-additional-options "-Wno-deprecated" { target c++2a } } +// { dg-do compile { target c++17 } } // Copyright (C) 2014-2020 Free Software Foundation, Inc. // @@ -142,6 +143,7 @@ static_assert(is_standard_layout_v static_assert(!is_standard_layout_v && !is_standard_layout::value, ""); +// Deprecated in C++20 static_assert(is_pod_v && is_pod::value, ""); static_assert(!is_pod_v -- 2.7.4