16015dd11SMarshall Clow //===----------------------------------------------------------------------===//
26015dd11SMarshall Clow //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66015dd11SMarshall Clow //
76015dd11SMarshall Clow //===----------------------------------------------------------------------===//
86015dd11SMarshall Clow 
9*a7f9895cSLouis Dionne // UNSUPPORTED: no-threads
1031cbe0f2SLouis Dionne // UNSUPPORTED: c++03, c++11, c++14
116015dd11SMarshall Clow 
126015dd11SMarshall Clow // <mutex>
136015dd11SMarshall Clow 
146015dd11SMarshall Clow // template <class ...Mutex> class scoped_lock;
156015dd11SMarshall Clow 
166015dd11SMarshall Clow // scoped_lock(scoped_lock const&) = delete;
176015dd11SMarshall Clow 
186015dd11SMarshall Clow #include <mutex>
196015dd11SMarshall Clow #include "test_macros.h"
206015dd11SMarshall Clow 
main(int,char **)212df59c50SJF Bastien int main(int, char**)
226015dd11SMarshall Clow {
236015dd11SMarshall Clow     using M = std::mutex;
246015dd11SMarshall Clow     M m0, m1, m2;
256015dd11SMarshall Clow     {
266015dd11SMarshall Clow         using LG = std::scoped_lock<>;
276015dd11SMarshall Clow         const LG Orig;
286015dd11SMarshall Clow         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
296015dd11SMarshall Clow     }
306015dd11SMarshall Clow     {
316015dd11SMarshall Clow         using LG = std::scoped_lock<M>;
326015dd11SMarshall Clow         const LG Orig(m0);
336015dd11SMarshall Clow         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
346015dd11SMarshall Clow     }
356015dd11SMarshall Clow     {
366015dd11SMarshall Clow         using LG = std::scoped_lock<M, M>;
376015dd11SMarshall Clow         const LG Orig(m0, m1);
386015dd11SMarshall Clow         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
396015dd11SMarshall Clow     }
406015dd11SMarshall Clow     {
416015dd11SMarshall Clow         using LG = std::scoped_lock<M, M, M>;
426015dd11SMarshall Clow         const LG Orig(m0, m1, m2);
436015dd11SMarshall Clow         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
446015dd11SMarshall Clow     }
452df59c50SJF Bastien 
462df59c50SJF Bastien   return 0;
476015dd11SMarshall Clow }
48