"_GLIBCXX17_DEPRECATED_SUGGEST(E)= " \
"_GLIBCXX20_DEPRECATED= " \
"_GLIBCXX20_DEPRECATED_SUGGEST(E)= " \
+ "_GLIBCXX23_DEPRECATED= " \
+ "_GLIBCXX23_DEPRECATED_SUGGEST(E)= " \
_GLIBCXX17_INLINE=inline \
_GLIBCXX_CHRONO_INT64_T=int64_t \
_GLIBCXX_DEFAULT_ABI_TAG \
// _GLIBCXX17_DEPRECATED_SUGGEST( string-literal )
// _GLIBCXX20_DEPRECATED
// _GLIBCXX20_DEPRECATED_SUGGEST( string-literal )
+// _GLIBCXX23_DEPRECATED
+// _GLIBCXX23_DEPRECATED_SUGGEST( string-literal )
#ifndef _GLIBCXX_USE_DEPRECATED
# define _GLIBCXX_USE_DEPRECATED 1
#endif
# define _GLIBCXX20_DEPRECATED_SUGGEST(ALT)
#endif
+#if defined(__DEPRECATED) && (__cplusplus >= 202100L)
+# define _GLIBCXX23_DEPRECATED [[__deprecated__]]
+# define _GLIBCXX23_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
+#else
+# define _GLIBCXX23_DEPRECATED
+# define _GLIBCXX23_DEPRECATED_SUGGEST(ALT)
+#endif
+
// Macros for ABI tag attributes.
#ifndef _GLIBCXX_ABI_TAG_CXX11
# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
* type shall be a POD type suitable for use as uninitialized
* storage for any object whose size is at most _Len and whose
* alignment is a divisor of _Align.
+ *
+ * @deprecated Deprecated in C++23. Uses can be replaced by an
+ * array std::byte[_Len] declared with alignas(_Align).
*/
template<std::size_t _Len, std::size_t _Align =
__alignof__(typename __aligned_storage_msa<_Len>::__type)>
- struct aligned_storage
+ struct
+ _GLIBCXX23_DEPRECATED
+ aligned_storage
{
union type
{
* least size _Len.
*
* @see aligned_storage
+ *
+ * @deprecated Deprecated in C++23.
*/
template <size_t _Len, typename... _Types>
- struct aligned_union
+ struct
+ _GLIBCXX23_DEPRECATED
+ aligned_union
{
private:
static_assert(sizeof...(_Types) != 0, "At least one type is required");
/// Alias template for aligned_storage
template<size_t _Len, size_t _Align =
__alignof__(typename __aligned_storage_msa<_Len>::__type)>
- using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
+ using aligned_storage_t _GLIBCXX23_DEPRECATED = typename aligned_storage<_Len, _Align>::type;
template <size_t _Len, typename... _Types>
- using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
+ using aligned_union_t _GLIBCXX23_DEPRECATED = typename aligned_union<_Len, _Types...>::type;
/// Alias template for decay
template<typename _Tp>
--- /dev/null
+// Copyright (C) 2022 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++23" }
+// { dg-do compile { target c++23 } }
+
+#include <type_traits>
+
+std::aligned_storage<1, 1>::type x; // { dg-warning "is deprecated" }
+std::aligned_storage_t<1, 1> y; // { dg-warning "is deprecated" }
+
+// { dg-prune-output "declared here" }
--- /dev/null
+// Copyright (C) 2022 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++23" }
+// { dg-do compile { target c++23 } }
+
+#include <type_traits>
+
+std::aligned_union<4, int>::type x; // { dg-warning "is deprecated" }
+std::aligned_union_t<4, int> y; // { dg-warning "is deprecated" }
+
+// { dg-prune-output "declared here" }