• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // 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 
ExplicitDefaultExplicitDefault25 struct ExplicitDefault { explicit ExplicitDefault() { } };
26 
explicit_default_test()27 std::tuple<ExplicitDefault> explicit_default_test() {
28     return {std::allocator_arg, std::allocator<int>()}; // expected-error {{chosen constructor is explicit in copy-initialization}}
29 }
30 
main(int,char **)31 int main(int, char**) {
32     return 0;
33 }
34