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 // Before GCC 6, aggregate initialization kicks in.
12 // See https://stackoverflow.com/q/41799015/627587.
13 // UNSUPPORTED: gcc-5
14 
15 // <tuple>
16 
17 // template <class... Types> class tuple;
18 
19 // explicit(see-below) constexpr tuple();
20 
21 #include <tuple>
22 
23 
24 struct Implicit {
25     Implicit() = default;
26 };
27 
28 struct Explicit {
29     explicit Explicit() = default;
30 };
31 
32 std::tuple<> test1() { return {}; }
33 
34 std::tuple<Implicit> test2() { return {}; }
35 std::tuple<Explicit> test3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
36 
37 std::tuple<Implicit, Implicit> test4() { return {}; }
38 std::tuple<Explicit, Implicit> test5() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
39 std::tuple<Implicit, Explicit> test6() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
40 std::tuple<Explicit, Explicit> test7() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
41 
42 std::tuple<Implicit, Implicit, Implicit> test8() { return {}; }
43 std::tuple<Implicit, Implicit, Explicit> test9() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
44 std::tuple<Implicit, Explicit, Implicit> test10() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
45 std::tuple<Implicit, Explicit, Explicit> test11() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
46 std::tuple<Explicit, Implicit, Implicit> test12() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
47 std::tuple<Explicit, Implicit, Explicit> test13() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
48 std::tuple<Explicit, Explicit, Implicit> test14() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
49 std::tuple<Explicit, Explicit, Explicit> test15() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
50 
51 int main(int, char**) {
52     return 0;
53 }
54