]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/17_intro/tag_type_explicit_ctor.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 17_intro / tag_type_explicit_ctor.cc
1 // { dg-do compile { target c++11 } }
2
3 // Copyright (C) 2015-2019 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
19
20 #include <new>
21 #include <utility>
22 #include <memory>
23 #include <mutex>
24
25 void f1(std::nothrow_t);
26 void f2(std::piecewise_construct_t);
27 void f3(std::allocator_arg_t);
28 void f4(std::defer_lock_t);
29 void f5(std::try_to_lock_t);
30 void f6(std::adopt_lock_t);
31
32
33 int main()
34 {
35 std::nothrow_t v1;
36 std::piecewise_construct_t v2;
37 std::allocator_arg_t v3;
38 std::defer_lock_t v4;
39 std::try_to_lock_t v5;
40 std::try_to_lock_t v6;
41 std::nothrow_t v7 = {}; // { dg-error "explicit" }
42 std::piecewise_construct_t v8 = {}; // { dg-error "explicit" }
43 std::allocator_arg_t v9 = {}; // { dg-error "explicit" }
44 std::defer_lock_t v10 = {}; // { dg-error "explicit" }
45 std::try_to_lock_t v11 = {}; // { dg-error "explicit" }
46 std::try_to_lock_t v12 = {}; // { dg-error "explicit" }
47 f1(std::nothrow_t{});
48 f2(std::piecewise_construct_t{});
49 f3(std::allocator_arg_t{});
50 f4(std::defer_lock_t{});
51 f5(std::try_to_lock_t{});
52 f6(std::adopt_lock_t{});
53 f1({}); // { dg-error "explicit" }
54 f2({}); // { dg-error "explicit" }
55 f3({}); // { dg-error "explicit" }
56 f4({}); // { dg-error "explicit" }
57 f5({}); // { dg-error "explicit" }
58 f6({}); // { dg-error "explicit" }
59 }