brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ec84907 Raw
38 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <tuple>10 11// template <class... Types> class tuple;12 13// template <class Alloc, class ...UTypes>14//   tuple(allocator_arg_t, const Alloc& a, tuple<UTypes...> const&);15 16// UNSUPPORTED: c++0317 18#include <tuple>19#include <memory>20 21struct ExplicitCopy {22  explicit ExplicitCopy(int) {}23  explicit ExplicitCopy(ExplicitCopy const&) {}24 25};26 27std::tuple<ExplicitCopy> const_explicit_copy_test() {28    const std::tuple<int> t1(42);29    return {std::allocator_arg, std::allocator<int>{}, t1};30    // expected-error@-1 {{chosen constructor is explicit in copy-initialization}}31}32 33std::tuple<ExplicitCopy> non_const_explicit_copy_test() {34    std::tuple<int> t1(42);35    return {std::allocator_arg, std::allocator<int>{}, t1};36    // expected-error@-1 {{chosen constructor is explicit in copy-initialization}}37}38