copy.pass.cpp 944 B

12345678910111213141516171819202122232425262728293031323334353637
  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. // UNSUPPORTED: c++98, c++03
  9. // <filesystem>
  10. // class path
  11. // path& operator=(path const&);
  12. #include "filesystem_include.hpp"
  13. #include <type_traits>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**) {
  17. using namespace fs;
  18. static_assert(std::is_copy_assignable<path>::value, "");
  19. static_assert(!std::is_nothrow_copy_assignable<path>::value, "should not be noexcept");
  20. const std::string s("foo");
  21. const path p(s);
  22. path p2;
  23. path& pref = (p2 = p);
  24. assert(p.native() == s);
  25. assert(p2.native() == s);
  26. assert(&pref == &p2);
  27. return 0;
  28. }