+2020-01-09 JeanHeyd "ThePhD" Meneide <phdofthehouse@gmail.com>
+
+ * include/bits/c++config (_GLIBCXX20_DEPRECATED): Add new macro.
+ * include/std/type_traits (is_pod, is_pod_v): Deprecate for C++20.
+ * testuite/20_util/is_pod/deprecated-2a.cc: New test.
+
2020-01-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/93205
// _GLIBCXX_USE_DEPRECATED
// _GLIBCXX_DEPRECATED
// _GLIBCXX17_DEPRECATED
+// _GLIBCXX20_DEPRECATED( string-literal )
#ifndef _GLIBCXX_USE_DEPRECATED
# define _GLIBCXX_USE_DEPRECATED 1
#endif
# define _GLIBCXX17_DEPRECATED
#endif
+#if defined(__DEPRECATED) && (__cplusplus > 201703L)
+# define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
+#else
+# define _GLIBCXX20_DEPRECATED(MSG)
+#endif
+
// Macros for ABI tag attributes.
#ifndef _GLIBCXX_ABI_TAG_CXX11
# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
"template argument must be a complete class or an unbounded array");
};
- /// is_pod
+ /// is_pod (deprecated in C++20)
// Could use is_standard_layout && is_trivial instead of the builtin.
template<typename _Tp>
- struct is_pod
+ struct
+ _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
+ is_pod
: public integral_constant<bool, __is_pod(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
template <typename _Tp>
inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value;
template <typename _Tp>
+ _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead")
inline constexpr bool is_pod_v = is_pod<_Tp>::value;
template <typename _Tp>
inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
--- /dev/null
+// Copyright (C) 2020 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++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <type_traits>
+
+static_assert(std::is_pod<int>::value); // { dg-warning "is deprecated" }
+static_assert(std::is_pod_v<int>); // { dg-warning "is deprecated" }
+
+// { dg-prune-output "declared here" }