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 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03 |
10 | |
11 | // <tuple> |
12 | |
13 | // template <class... Types> class tuple; |
14 | |
15 | // explicit(see-below) constexpr tuple(); |
16 | |
17 | #include <tuple> |
18 | |
19 | |
20 | struct Implicit { |
21 | Implicit() = default; |
22 | }; |
23 | |
24 | struct Explicit { |
25 | explicit Explicit() = default; |
26 | }; |
27 | |
28 | std::tuple<> test1() { return {}; } |
29 | |
30 | std::tuple<Implicit> test2() { return {}; } |
31 | std::tuple<Explicit> test3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
32 | |
33 | std::tuple<Implicit, Implicit> test4() { return {}; } |
34 | std::tuple<Explicit, Implicit> test5() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
35 | std::tuple<Implicit, Explicit> test6() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
36 | std::tuple<Explicit, Explicit> test7() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
37 | |
38 | std::tuple<Implicit, Implicit, Implicit> test8() { return {}; } |
39 | std::tuple<Implicit, Implicit, Explicit> test9() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
40 | std::tuple<Implicit, Explicit, Implicit> test10() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
41 | std::tuple<Implicit, Explicit, Explicit> test11() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
42 | std::tuple<Explicit, Implicit, Implicit> test12() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
43 | std::tuple<Explicit, Implicit, Explicit> test13() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
44 | std::tuple<Explicit, Explicit, Implicit> test14() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
45 | std::tuple<Explicit, Explicit, Explicit> test15() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} |
46 | |