diff options
Diffstat (limited to 'libcxx/test/support')
| -rw-r--r-- | libcxx/test/support/uses_alloc_types.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libcxx/test/support/uses_alloc_types.hpp b/libcxx/test/support/uses_alloc_types.hpp index f68b842a708..a88453c6c03 100644 --- a/libcxx/test/support/uses_alloc_types.hpp +++ b/libcxx/test/support/uses_alloc_types.hpp @@ -160,26 +160,26 @@ protected: allocator(a) {} - template <class ...Args> + template <class ...Args, class ArgsIDL = detail::TakeNArgs<sizeof...(Args) - 1, Args&&...>> UsesAllocatorTestBase(AllocLastTag, Args&&... args) - : args_id(nullptr), - constructor_called(UA_AllocLast) + : args_id(&makeTypeID<typename ArgsIDL::type>()), + constructor_called(UA_AllocLast), + allocator(getAllocatorFromPack( + typename ArgsIDL::type{}, + std::forward<Args>(args)...)) { - typedef typename detail::TakeNArgs<sizeof...(Args) - 1, Args&&...>::type - ArgIDL; - args_id = &makeTypeID<ArgIDL>(); - getAllocatorFromPack(ArgIDL{}, std::forward<Args>(args)...); } private: template <class ...LArgs, class ...Args> - void getAllocatorFromPack(ArgumentListID<LArgs...>, Args&&... args) { - getAllocatorFromPackImp<LArgs const&...>(args...); + static CtorAlloc const& getAllocatorFromPack(ArgumentListID<LArgs...>, Args&&... args) { + return getAllocatorFromPackImp<LArgs const&...>(args...); } template <class ...LArgs> - void getAllocatorFromPackImp(typename detail::Identity<LArgs>::type..., CtorAlloc const& alloc) { - allocator = alloc; + static CtorAlloc const& getAllocatorFromPackImp( + typename detail::Identity<LArgs>::type..., CtorAlloc const& alloc) { + return alloc; } const TypeID* args_id; |

