From: Eric Fiselier Date: Mon, 8 Aug 2016 02:22:41 +0000 (+0000) Subject: Fix copy/move constructor annotation for the uses-allocator test types. X-Git-Tag: llvmorg-4.0.0-rc1~13098 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d711627b4977ff9aef83d61c5fc0c510f561dcb;p=platform%2Fupstream%2Fllvm.git Fix copy/move constructor annotation for the uses-allocator test types. Previously the copy/move constructors of the test types did not properly set the arg_id to T const& or T&& respectivly. llvm-svn: 277970 --- diff --git a/libcxx/test/support/uses_alloc_types.hpp b/libcxx/test/support/uses_alloc_types.hpp index 834e577..0961f72 100644 --- a/libcxx/test/support/uses_alloc_types.hpp +++ b/libcxx/test/support/uses_alloc_types.hpp @@ -119,7 +119,7 @@ using detail::EnableIfB; struct AllocLastTag {}; -template +template struct UsesAllocatorTestBase { public: using CtorAlloc = typename std::conditional< @@ -153,6 +153,16 @@ protected: : args_id(aid), constructor_called(UA_None), allocator() {} + UsesAllocatorTestBase(UsesAllocatorTestBase const&) + : args_id(&makeArgumentID()), constructor_called(UA_None), + allocator() + {} + + UsesAllocatorTestBase(UsesAllocatorTestBase&&) + : args_id(&makeArgumentID()), constructor_called(UA_None), + allocator() + {} + template UsesAllocatorTestBase(std::allocator_arg_t, CtorAlloc const& a, Args&&...) : args_id(&makeArgumentID()), @@ -188,12 +198,12 @@ private: }; template -class UsesAllocatorV1 : public UsesAllocatorTestBase +class UsesAllocatorV1 : public UsesAllocatorTestBase, Alloc> { public: typedef Alloc allocator_type; - using Base = UsesAllocatorTestBase; + using Base = UsesAllocatorTestBase; using CtorAlloc = typename Base::CtorAlloc; UsesAllocatorV1() : Base(&makeArgumentID<>()) {} @@ -218,12 +228,12 @@ public: template -class UsesAllocatorV2 : public UsesAllocatorTestBase +class UsesAllocatorV2 : public UsesAllocatorTestBase, Alloc> { public: typedef Alloc allocator_type; - using Base = UsesAllocatorTestBase; + using Base = UsesAllocatorTestBase; using CtorAlloc = typename Base::CtorAlloc; UsesAllocatorV2() : Base(&makeArgumentID<>()) {} @@ -240,12 +250,12 @@ public: }; template -class UsesAllocatorV3 : public UsesAllocatorTestBase +class UsesAllocatorV3 : public UsesAllocatorTestBase, Alloc> { public: typedef Alloc allocator_type; - using Base = UsesAllocatorTestBase; + using Base = UsesAllocatorTestBase; using CtorAlloc = typename Base::CtorAlloc; UsesAllocatorV3() : Base(&makeArgumentID<>()) {} @@ -268,12 +278,12 @@ public: }; template -class NotUsesAllocator : public UsesAllocatorTestBase +class NotUsesAllocator : public UsesAllocatorTestBase, Alloc> { public: // no allocator_type typedef provided - using Base = UsesAllocatorTestBase; + using Base = UsesAllocatorTestBase; using CtorAlloc = typename Base::CtorAlloc; NotUsesAllocator() : Base(&makeArgumentID<>()) {}