native.pass.cpp 967 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // const string_type& native() const noexcept;
  12. #include "filesystem_include.hpp"
  13. #include <type_traits>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. #include "filesystem_test_helper.hpp"
  17. int main(int, char**)
  18. {
  19. using namespace fs;
  20. const char* const value = "hello world";
  21. { // Check signature
  22. path p(value);
  23. ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
  24. ASSERT_NOEXCEPT(p.native());
  25. }
  26. { // native() is tested elsewhere
  27. path p(value);
  28. assert(p.native() == value);
  29. }
  30. return 0;
  31. }