assign.fail.cpp 757 B

123456789101112131415161718192021222324252627
  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, c++14
  11. // <shared_mutex>
  12. // class shared_mutex;
  13. // shared_mutex& operator=(const shared_mutex&) = delete;
  14. #include <shared_mutex>
  15. int main(int, char**)
  16. {
  17. std::shared_mutex m0;
  18. std::shared_mutex m1;
  19. m1 = m0; // expected-error {{overload resolution selected deleted operator '='}}
  20. return 0;
  21. }