summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-11-14 10:34:21 +0000
committerJonathan Wakely <jwakely@redhat.com>2025-11-14 11:01:10 +0000
commit0c57a97066ceea1713a66a9ac9bc982c5941d1e7 (patch)
tree06374314e14035e6a862762007f109d3389f8d48
parenta9d6de2007d142c9dee14b45664e5a3a7e0b2df6 (diff)
libstdc++: Fix -Wdeprecated-declarations warning in <any>
When GCC is configured with --enable-libstdcxx-pch (which is the default) compiling 20_util/ratio/operations/ops_overflow_neg.cc with C++23 or later triggers a warning in <any> about std::aligned_storage being deprecated. FAIL: 20_util/ratio/operations/ops_overflow_neg.cc -std=gnu++23 (test for excess errors) Excess errors: .../include/any:93: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations] libstdc++-v3/ChangeLog: * include/std/any: Add diagnostic pragmas to disable warning about std::aligned_storage being deprecated.
-rw-r--r--libstdc++-v3/include/std/any5
1 files changed, 5 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/any b/libstdc++-v3/include/std/any
index e4709b1ce04..974805e188f 100644
--- a/libstdc++-v3/include/std/any
+++ b/libstdc++-v3/include/std/any
@@ -42,6 +42,9 @@
#include <type_traits>
#include <bits/utility.h> // in_place_type_t
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // aligned_storage
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -661,5 +664,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
+#pragma GCC diagnostic pop
+
#endif // __cpp_lib_any
#endif // _GLIBCXX_ANY