diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-12-14 21:29:29 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-12-14 21:29:29 +0000 |
| commit | 4ffd08cae91e6bfbf1519420aeb096964d27fd39 (patch) | |
| tree | 14d8bd3bb9ab233e6ed25243c132f2ada96a8c59 /libcxx/include/__functional_base | |
| parent | fec6be9c8150244c98bc2ac2bcac326fce49001a (diff) | |
| download | bcm5719-llvm-4ffd08cae91e6bfbf1519420aeb096964d27fd39.tar.gz bcm5719-llvm-4ffd08cae91e6bfbf1519420aeb096964d27fd39.zip | |
[libcxx] Fix PR24075, PR23841 - Add scoped_allocator_adaptor::construct(pair<T, U>*, ...) overloads.
Summary:
For more information see:
* https://llvm.org/bugs/show_bug.cgi?id=23841
* https://llvm.org/bugs/show_bug.cgi?id=24075
I hope you have as much fun reviewing as I did writing these insane tests!
Reviewers: mclow.lists, AlisdairM, EricWF
Subscribers: AlisdairM, Potatoswatter, cfe-commits
Differential Revision: https://reviews.llvm.org/D27612
llvm-svn: 289710
Diffstat (limited to 'libcxx/include/__functional_base')
| -rw-r--r-- | libcxx/include/__functional_base | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base index 82b414674ea..6e2cfefc597 100644 --- a/libcxx/include/__functional_base +++ b/libcxx/include/__functional_base @@ -637,7 +637,8 @@ constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; template <class _Tp, class _Alloc, class ..._Args> struct __uses_alloc_ctor_imp { - static const bool __ua = uses_allocator<_Tp, _Alloc>::value; + typedef typename __uncvref<_Alloc>::type _RawAlloc; + static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; static const bool __ic = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; static const int value = __ua ? 2 - __ic : 0; @@ -655,6 +656,7 @@ void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, con new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); } +// FIXME: This should have a version which takes a non-const alloc. template <class _Tp, class _Allocator, class... _Args> inline _LIBCPP_INLINE_VISIBILITY void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) @@ -662,6 +664,7 @@ void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, con new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); } +// FIXME: This should have a version which takes a non-const alloc. template <class _Tp, class _Allocator, class... _Args> inline _LIBCPP_INLINE_VISIBILITY void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) @@ -669,6 +672,7 @@ void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, con new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); } +// FIXME: Theis should have a version which takes a non-const alloc. template <class _Tp, class _Allocator, class... _Args> inline _LIBCPP_INLINE_VISIBILITY void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args) |

