mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@266703 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <tuple>
|
|
|
|
// template <class... Types> class tuple;
|
|
|
|
// template <class Alloc, class ...UTypes>
|
|
// tuple(allocator_arg_t, const Alloc& a, tuple<UTypes...> const&);
|
|
|
|
// UNSUPPORTED: c++98, c++03
|
|
|
|
#include <tuple>
|
|
#include <memory>
|
|
|
|
struct ExplicitCopy {
|
|
explicit ExplicitCopy(int) {}
|
|
explicit ExplicitCopy(ExplicitCopy const&) {}
|
|
|
|
};
|
|
|
|
std::tuple<ExplicitCopy> const_explicit_copy_test() {
|
|
const std::tuple<int> t1(42);
|
|
return {std::allocator_arg, std::allocator<void>{}, t1};
|
|
// expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
|
|
}
|
|
|
|
std::tuple<ExplicitCopy> non_const_explicit_copy_test() {
|
|
std::tuple<int> t1(42);
|
|
return {std::allocator_arg, std::allocator<void>{}, t1};
|
|
// expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
|
|
}
|
|
|
|
int main()
|
|
{
|
|
|
|
}
|