2019-05-10 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/90397
+ * include/std/variant (_Variant_storage<false, Types...>::_M_storage())
+ (_Variant_storage<true, Types...>::_M_reset()))
+ (_Variant_storage<true, Types...>::_M_storage())): Add noexcept.
+ (__get_storage): Likewise.
+ (variant): Add noexcept to friend declarations for __get and
+ __get_storage.
+
PR libstdc++/90388
* include/bits/unique_ptr.h (default_delete, default_delete<T[]>):
Use _Require for constraints.
{ _M_reset(); }
void*
- _M_storage() const
+ _M_storage() const noexcept
{
return const_cast<void*>(static_cast<const void*>(
std::addressof(_M_u)));
_M_index(_Np)
{ }
- void _M_reset()
+ void _M_reset() noexcept
{ _M_index = variant_npos; }
void*
- _M_storage() const
+ _M_storage() const noexcept
{
return const_cast<void*>(static_cast<const void*>(
std::addressof(_M_u)));
// Returns the raw storage for __v.
template<typename _Variant>
- void* __get_storage(_Variant&& __v)
+ void* __get_storage(_Variant&& __v) noexcept
{ return __v._M_storage(); }
template <typename _Maybe_variant_cookie, typename _Variant>
#endif
template<size_t _Np, typename _Vp>
- friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v);
+ friend constexpr decltype(auto)
+ __detail::__variant::__get(_Vp&& __v) noexcept;
template<typename _Vp>
- friend void* __detail::__variant::__get_storage(_Vp&& __v);
+ friend void*
+ __detail::__variant::__get_storage(_Vp&& __v) noexcept;
#define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP) \
template<typename... _Tp> \