1 //===----------------------------------------------------------------------===//
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-exception
7 //===----------------------------------------------------------------------===//
13 // template <class T1, class T2> struct pair
15 // explicit(see-below) constexpr pair();
17 // This test checks the conditional explicitness of std::pair's default
18 // constructor as introduced by the resolution of https://wg21.link/LWG2510.
23 struct ImplicitlyDefaultConstructible
{
24 ImplicitlyDefaultConstructible() = default;
27 struct ExplicitlyDefaultConstructible
{
28 explicit ExplicitlyDefaultConstructible() = default;
31 std::pair
<ImplicitlyDefaultConstructible
, ExplicitlyDefaultConstructible
> test1() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
32 std::pair
<ExplicitlyDefaultConstructible
, ImplicitlyDefaultConstructible
> test2() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
33 std::pair
<ExplicitlyDefaultConstructible
, ExplicitlyDefaultConstructible
> test3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
34 std::pair
<ImplicitlyDefaultConstructible
, ImplicitlyDefaultConstructible
> test4() { return {}; }