diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-04-19 01:19:25 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-04-19 01:19:25 +0000 |
commit | 9795699a7282a29d1a0a5c202209c6e2a4cc5539 (patch) | |
tree | 8a0a829dc3e86541e2bd74b35b316bed3c1e62f1 /libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp | |
parent | 167c7962321f063a713957296e37e5b1903cf007 (diff) | |
download | bcm5719-llvm-9795699a7282a29d1a0a5c202209c6e2a4cc5539.tar.gz bcm5719-llvm-9795699a7282a29d1a0a5c202209c6e2a4cc5539.zip |
Make tuples constructors conditionally EXPLICIT. See N4387
llvm-svn: 266703
Diffstat (limited to 'libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp index 5ad4f9227f4..e176bc84f79 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp @@ -20,6 +20,16 @@ #include <string> #include <cassert> +struct Explicit { + int value; + explicit Explicit(int x) : value(x) {} +}; + +struct Implicit { + int value; + Implicit(int x) : value(x) {} +}; + struct B { int id_; @@ -115,4 +125,14 @@ int main() assert(std::get<1>(t1) == int('a')); assert(std::get<2>(t1).id_ == 3); } + { + const std::tuple<int> t1(42); + std::tuple<Explicit> t2(t1); + assert(std::get<0>(t2).value == 42); + } + { + const std::tuple<int> t1(42); + std::tuple<Implicit> t2 = t1; + assert(std::get<0>(t2).value == 42); + } } |