Home | History | Annotate | Download | only in tuple.cnstr
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <tuple>
     11 
     12 // template <class... Types> class tuple;
     13 
     14 // template <class Alloc, class ...UTypes>
     15 //   tuple(allocator_arg_t, const Alloc& a, tuple<UTypes...> const&);
     16 
     17 // UNSUPPORTED: c++98, c++03
     18 
     19 #include <tuple>
     20 #include <memory>
     21 
     22 struct ExplicitCopy {
     23   explicit ExplicitCopy(int) {}
     24   explicit ExplicitCopy(ExplicitCopy const&) {}
     25 
     26 };
     27 
     28 std::tuple<ExplicitCopy> const_explicit_copy_test() {
     29     const std::tuple<int> t1(42);
     30     return {std::allocator_arg, std::allocator<void>{}, t1};
     31     // expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
     32 }
     33 
     34 std::tuple<ExplicitCopy> non_const_explicit_copy_test() {
     35     std::tuple<int> t1(42);
     36     return {std::allocator_arg, std::allocator<void>{}, t1};
     37     // expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
     38 }
     39 
     40 int main()
     41 {
     42 
     43 }
     44