31 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// UNSUPPORTED: no-threads10// UNSUPPORTED: c++03, c++1111 12// <shared_mutex>13 14// template <class Mutex> class shared_lock;15 16// shared_lock();17 18#include <shared_mutex>19#include <cassert>20 21#include "test_macros.h"22 23int main(int, char**)24{25 std::shared_lock<std::shared_timed_mutex> ul;26 assert(!ul.owns_lock());27 assert(ul.mutex() == nullptr);28 29 return 0;30}31