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 { ExplicitCopyExplicitCopy23 explicit ExplicitCopy(int) {} ExplicitCopyExplicitCopy24 explicit ExplicitCopy(ExplicitCopy const&) {} 25 26 }; 27 const_explicit_copy_test()28std::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 non_const_explicit_copy_test()34std::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 main()40int main() 41 { 42 43 } 44