brintos

brintos / llvm-project-archived public Read only

0
0
Text · 911 B · 0ce92da Raw
30 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// UNSUPPORTED: c++0310 11// <tuple>12 13// template <class... Types> class tuple;14 15// template <class Alloc>16//   explicit(see-below) tuple(allocator_arg_t, const Alloc& a);17 18// Make sure we get the explicit-ness of the constructor right.19// This is LWG 3158.20 21#include <tuple>22#include <memory>23 24 25struct ExplicitDefault { explicit ExplicitDefault() { } };26 27std::tuple<ExplicitDefault> explicit_default_test() {28    return {std::allocator_arg, std::allocator<int>()}; // expected-error {{chosen constructor is explicit in copy-initialization}}29}30