default.pass.cpp 764 B

1234567891011121314151617181920212223242526272829
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // UNSUPPORTED: libcpp-has-no-threads
  10. // UNSUPPORTED: c++98, c++03, c++11
  11. // XFAIL: dylib-has-no-shared_mutex
  12. // <shared_mutex>
  13. // template <class Mutex> class shared_lock;
  14. // shared_lock();
  15. #include <shared_mutex>
  16. #include <cassert>
  17. int main(int, char**)
  18. {
  19. std::shared_lock<std::shared_timed_mutex> ul;
  20. assert(!ul.owns_lock());
  21. assert(ul.mutex() == nullptr);
  22. return 0;
  23. }