* include/bits/c++config (_GLIBCXX17_DEPRECATED): Define.
* include/bits/functional_hash.h (__hash_base::result_type)
(__hash_base::argument_type): Add _GLIBCXX17_DEPRECATED.
* include/std/optional (hash<optional<T>>::result_type)
(hash<optional<T>>::argument_type): Add deprecated attribute.
(__is_fast_hash<hash<optional<T>>>): Add partial specialization.
* include/std/variant (hash<variant<Types...>>::result_type)
(hash<variant<Types...>>::argument_type): Add deprecated attribute.
(__is_fast_hash<hash<variant<Types...>>>): Add partial specialization.
From-SVN: r253017
2017-09-20 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/c++config (_GLIBCXX17_DEPRECATED): Define.
+ * include/bits/functional_hash.h (__hash_base::result_type)
+ (__hash_base::argument_type): Add _GLIBCXX17_DEPRECATED.
+ * include/std/optional (hash<optional<T>>::result_type)
+ (hash<optional<T>>::argument_type): Add deprecated attribute.
+ (__is_fast_hash<hash<optional<T>>>): Add partial specialization.
+ * include/std/variant (hash<variant<Types...>>::result_type)
+ (hash<variant<Types...>>::argument_type): Add deprecated attribute.
+ (__is_fast_hash<hash<variant<Types...>>>): Add partial specialization.
+
* libsupc++/exception_ptr.h (copy_exception): Remove deprecated
non-standard function.
// Macros for deprecated attributes.
// _GLIBCXX_USE_DEPRECATED
// _GLIBCXX_DEPRECATED
+// _GLIBCXX17_DEPRECATED
#ifndef _GLIBCXX_USE_DEPRECATED
# define _GLIBCXX_USE_DEPRECATED 1
#endif
# define _GLIBCXX_DEPRECATED
#endif
+#if defined(__DEPRECATED) && (__cplusplus >= 201703L)
+# define _GLIBCXX17_DEPRECATED [[__deprecated__]]
+#else
+# define _GLIBCXX17_DEPRECATED
+#endif
+
// Macros for ABI tag attributes.
#ifndef _GLIBCXX_ABI_TAG_CXX11
# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11")))
template<typename _Result, typename _Arg>
struct __hash_base
{
- typedef _Result result_type;
- typedef _Arg argument_type;
+ typedef _Result result_type _GLIBCXX17_DEPRECATED;
+ typedef _Arg argument_type _GLIBCXX17_DEPRECATED;
};
/// Primary class template hash.
: private __poison_hash<remove_const_t<_Tp>>,
public __optional_hash_call_base<_Tp>
{
- using result_type = size_t;
- using argument_type = optional<_Tp>;
+ using result_type [[__deprecated__]] = size_t;
+ using argument_type [[__deprecated__]] = optional<_Tp>;
};
+ template<typename _Tp>
+ struct __is_fast_hash<hash<optional<_Tp>>> : __is_fast_hash<hash<_Tp>>
+ { };
+
/// @}
template <typename _Tp> optional(_Tp) -> optional<_Tp>;
variant<_Types...>, std::index_sequence_for<_Types...>>,
public __variant_hash_call_base<_Types...>
{
- using result_type = size_t;
- using argument_type = variant<_Types...>;
+ using result_type [[__deprecated__]] = size_t;
+ using argument_type [[__deprecated__]] = variant<_Types...>;
};
template<>
struct hash<monostate>
{
- using result_type = size_t;
- using argument_type = monostate;
+ using result_type [[__deprecated__]] = size_t;
+ using argument_type [[__deprecated__]] = monostate;
size_t
operator()(const monostate& __t) const noexcept
}
};
+ template<typename... _Types>
+ struct __is_fast_hash<hash<variant<_Types...>>>
+ : bool_constant<(__is_fast_hash<_Types>::value && ...)>
+ { };
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std