Avoid embedded preprocessor directives in __tree
Similar to rL242623, move C++ version checks outside of _NOEXCEPT_() macro invocation argument lists, to avoid "embedding a directive within macro arguments has undefined behavior" warnings. Differential Revision: https://reviews.llvm.org/D23961 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1111,14 +1111,15 @@ public:
|
|||||||
void clear() _NOEXCEPT;
|
void clear() _NOEXCEPT;
|
||||||
|
|
||||||
void swap(__tree& __t)
|
void swap(__tree& __t)
|
||||||
|
#if _LIBCPP_STD_VER <= 11
|
||||||
_NOEXCEPT_(
|
_NOEXCEPT_(
|
||||||
__is_nothrow_swappable<value_compare>::value
|
__is_nothrow_swappable<value_compare>::value
|
||||||
#if _LIBCPP_STD_VER <= 11
|
|
||||||
&& (!__node_traits::propagate_on_container_swap::value ||
|
&& (!__node_traits::propagate_on_container_swap::value ||
|
||||||
__is_nothrow_swappable<__node_allocator>::value)
|
__is_nothrow_swappable<__node_allocator>::value)
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
_NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_CXX03_LANG
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
template <class _Key, class ..._Args>
|
template <class _Key, class ..._Args>
|
||||||
@@ -1797,13 +1798,15 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
|
|||||||
template <class _Tp, class _Compare, class _Allocator>
|
template <class _Tp, class _Compare, class _Allocator>
|
||||||
void
|
void
|
||||||
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
|
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
|
||||||
|
#if _LIBCPP_STD_VER <= 11
|
||||||
_NOEXCEPT_(
|
_NOEXCEPT_(
|
||||||
__is_nothrow_swappable<value_compare>::value
|
__is_nothrow_swappable<value_compare>::value
|
||||||
#if _LIBCPP_STD_VER <= 11
|
|
||||||
&& (!__node_traits::propagate_on_container_swap::value ||
|
&& (!__node_traits::propagate_on_container_swap::value ||
|
||||||
__is_nothrow_swappable<__node_allocator>::value)
|
__is_nothrow_swappable<__node_allocator>::value)
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
|
#else
|
||||||
|
_NOEXCEPT_(__is_nothrow_swappable<value_compare>::value)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
using _VSTD::swap;
|
using _VSTD::swap;
|
||||||
swap(__begin_node_, __t.__begin_node_);
|
swap(__begin_node_, __t.__begin_node_);
|
||||||
|
|||||||
Reference in New Issue
Block a user