mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-13 21:01:29 +08:00
PR libstdc++/90397 fix std::variant friend declarations
Clang diagnoses the inconsistent noexcept-specifier on the friend declaration of __get. Add it, and also on __get_storage. 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. From-SVN: r271079
This commit is contained in:
parent
7fb65a8759
commit
4b7a3ab82f
@ -1,5 +1,13 @@
|
||||
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.
|
||||
|
@ -402,7 +402,7 @@ namespace __variant
|
||||
{ _M_reset(); }
|
||||
|
||||
void*
|
||||
_M_storage() const
|
||||
_M_storage() const noexcept
|
||||
{
|
||||
return const_cast<void*>(static_cast<const void*>(
|
||||
std::addressof(_M_u)));
|
||||
@ -432,11 +432,11 @@ namespace __variant
|
||||
_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)));
|
||||
@ -760,7 +760,7 @@ namespace __variant
|
||||
|
||||
// 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>
|
||||
@ -1556,10 +1556,12 @@ namespace __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> \
|
||||
|
Loading…
x
Reference in New Issue
Block a user