1 // { dg-do compile { target c++11 } }
3 // Copyright (C) 2015-2024 Free Software Foundation, Inc.
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)
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.
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/>.
28 void f1(std::nothrow_t
);
29 void f2(std::piecewise_construct_t
);
30 void f3(std::allocator_arg_t
);
32 void f4(std::defer_lock_t
);
33 void f5(std::try_to_lock_t
);
34 void f6(std::adopt_lock_t
);
37 #pragma GCC diagnostic ignored "-Wunused-variable"
42 std::piecewise_construct_t v2
;
43 std::allocator_arg_t v3
;
46 std::try_to_lock_t v5
;
47 std::try_to_lock_t v6
;
49 std::nothrow_t v7
= {}; // { dg-error "explicit" }
50 std::piecewise_construct_t v8
= {}; // { dg-error "explicit" }
51 std::allocator_arg_t v9
= {}; // { dg-error "explicit" }
53 std::defer_lock_t v10
= {}; // { dg-error "explicit" "" { target hosted } }
54 std::try_to_lock_t v11
= {}; // { dg-error "explicit" "" { target hosted } }
55 std::try_to_lock_t v12
= {}; // { dg-error "explicit" "" { target hosted } }
58 f2(std::piecewise_construct_t
{});
59 f3(std::allocator_arg_t
{});
60 f1({}); // { dg-error "explicit" }
61 f2({}); // { dg-error "explicit" }
62 f3({}); // { dg-error "explicit" }
64 f4(std::defer_lock_t
{});
65 f5(std::try_to_lock_t
{});
66 f6(std::adopt_lock_t
{});
67 f4({}); // { dg-error "explicit" "" { target hosted } }
68 f5({}); // { dg-error "explicit" "" { target hosted } }
69 f6({}); // { dg-error "explicit" "" { target hosted } }