Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / utility / pairs / pairs.pair / ctor.default.explicit_LWG2510.verify.cpp
blob18b9ab32887aa6fb97342293af3c7a64700f2212
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <utility>
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.
20 #include <utility>
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 {}; }