From 51072bd6bf79ef2bc6a922079bff57c31c1effbc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:47:26 +0000 Subject: Vendor import of libc++ release_39 branch r276489: https://llvm.org/svn/llvm-project/libcxx/branches/release_39@276489 --- .../tuple.cnstr/alloc_convert_copy.pass.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp') diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp index 8acfde7a98eb..36d9f32879cb 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.pass.cpp @@ -17,12 +17,23 @@ // UNSUPPORTED: c++98, c++03 #include +#include #include #include "allocators.h" #include "../alloc_first.h" #include "../alloc_last.h" +struct Explicit { + int value; + explicit Explicit(int x) : value(x) {} +}; + +struct Implicit { + int value; + Implicit(int x) : value(x) {} +}; + int main() { { @@ -66,4 +77,14 @@ int main() assert(std::get<1>(t1) == 2); assert(std::get<2>(t1) == 3); } + { + const std::tuple t1(42); + std::tuple t2{std::allocator_arg, std::allocator{}, t1}; + assert(std::get<0>(t2).value == 42); + } + { + const std::tuple t1(42); + std::tuple t2 = {std::allocator_arg, std::allocator{}, t1}; + assert(std::get<0>(t2).value == 42); + } } -- cgit v1.2.3