blob: c7fd0e94b771e0ea0dc257dbb56e44522164e1d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
// <mutex>
// template <class ...Mutex> class lock_guard;
// lock_guard(lock_guard const&) = delete;
// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
#include <mutex>
int main()
{
using M = std::mutex;
M m0, m1, m2;
{
using LG = std::lock_guard<>;
const LG Orig;
LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
}
{
using LG = std::lock_guard<M, M>;
const LG Orig(m0, m1);
LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
}
{
using LG = std::lock_guard<M, M, M>;
const LG Orig(m0, m1, m2);
LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
}
}
|