From a9ad2ca8bd25366818ad8488f214c0b04e04c00e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 30 Jul 2011 17:35:20 +0000 Subject: [PATCH] Synch up with recent changes in trunk git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/apple@136574 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 3 +++ include/memory | 2 +- include/type_traits | 4 ++++ include/utility | 9 ++++++--- include/valarray | 17 +++++++++++++++++ src/exception.cpp | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/__config b/include/__config index 0c46f761..2f75ed88 100644 --- a/include/__config +++ b/include/__config @@ -146,6 +146,9 @@ typedef __char32_t char32_t; #if !(__has_feature(cxx_auto_type)) #define _LIBCPP_HAS_NO_AUTO_TYPE +#endif + +#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return) #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #endif diff --git a/include/memory b/include/memory index 1972d06f..d272c08c 100644 --- a/include/memory +++ b/include/memory @@ -1294,7 +1294,7 @@ struct __has_allocate_hint #endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE -#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE +#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS) template decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(), diff --git a/include/type_traits b/include/type_traits index ec12b6b9..be893b0d 100644 --- a/include/type_traits +++ b/include/type_traits @@ -3014,11 +3014,15 @@ struct __invoke_of template inline _LIBCPP_INLINE_VISIBILITY +#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE typename enable_if < is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value >::type +#else +void +#endif swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value && is_nothrow_move_assignable<_Tp>::value) { diff --git a/include/utility b/include/utility index d0aee559..358fe765 100644 --- a/include/utility +++ b/include/utility @@ -226,9 +226,12 @@ struct _LIBCPP_VISIBLE pair template _LIBCPP_INLINE_VISIBILITY - pair(const pair<_U1, _U2>& __p, - typename enable_if::value && - is_constructible<_T2, _U2>::value>::type* = 0) + pair(const pair<_U1, _U2>& __p +#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE + ,typename enable_if::value && + is_constructible<_T2, _U2>::value>::type* = 0 +#endif + ) : first(__p.first), second(__p.second) {} _LIBCPP_INLINE_VISIBILITY diff --git a/include/valarray b/include/valarray index 40c1fe12..d7a173cf 100644 --- a/include/valarray +++ b/include/valarray @@ -817,6 +817,8 @@ public: valarray& operator=(const gslice_array& __ga); valarray& operator=(const mask_array& __ma); valarray& operator=(const indirect_array& __ia); + template + valarray& operator=(const __val_expr<_ValExpr>& __v); // element access: _LIBCPP_INLINE_VISIBILITY @@ -2958,6 +2960,21 @@ valarray<_Tp>::operator=(const indirect_array& __ia) return *this; } +template +template +inline _LIBCPP_INLINE_VISIBILITY +valarray<_Tp>& +valarray<_Tp>::operator=(const __val_expr<_ValExpr>& __v) +{ + size_t __n = __v.size(); + if (size() != __n) + resize(__n); + value_type* __t = __begin_; + for (size_t __i = 0; __i != __n; ++__t, ++__i) + *__t = result_type(__v[__i]); + return *this; +} + template inline _LIBCPP_INLINE_VISIBILITY __val_expr<__slice_expr&> > diff --git a/src/exception.cpp b/src/exception.cpp index b0efda64..28d87b34 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -56,6 +56,7 @@ std::get_terminate() _NOEXCEPT return __sync_fetch_and_add(&__terminate_handler, (std::terminate_handler)0); } +_ATTRIBUTE(noreturn) void std::terminate() _NOEXCEPT {