summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorDimitry Andric <dimitry@andric.com>2016-08-27 19:32:03 +0000
committerDimitry Andric <dimitry@andric.com>2016-08-27 19:32:03 +0000
commitf8563f32068aa0207a0751f47b689492375a38e7 (patch)
tree782e74f4e856f514e86b8d1739f89523b27ffd8a /libcxx
parent38814fa2fd964623658a860914b6222e309a2bf9 (diff)
downloadbcm5719-llvm-f8563f32068aa0207a0751f47b689492375a38e7.tar.gz
bcm5719-llvm-f8563f32068aa0207a0751f47b689492375a38e7.zip
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 llvm-svn: 279926
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__tree13
1 files changed, 8 insertions, 5 deletions
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index b560bf071e8..f3f68b5595f 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -1111,14 +1111,15 @@ public:
void clear() _NOEXCEPT;
void swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
);
-
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
+#endif
#ifndef _LIBCPP_CXX03_LANG
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>
void
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
)
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value)
+#endif
{
using _VSTD::swap;
swap(__begin_node_, __t.__begin_node_);
OpenPOWER on IntegriCloud