synop.pass.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // typedef ... value_type;
  12. // typedef basic_string<value_type> string_type;
  13. // static constexpr value_type preferred_separator = ...;
  14. #include "filesystem_include.hpp"
  15. #include <type_traits>
  16. #include <cassert>
  17. #include "test_macros.h"
  18. int main(int, char**) {
  19. using namespace fs;
  20. ASSERT_SAME_TYPE(path::value_type, char);
  21. ASSERT_SAME_TYPE(path::string_type, std::basic_string<path::value_type>);
  22. {
  23. ASSERT_SAME_TYPE(const path::value_type, decltype(path::preferred_separator));
  24. static_assert(path::preferred_separator == '/', "");
  25. // Make preferred_separator ODR used by taking its address.
  26. const char* dummy = &path::preferred_separator;
  27. ((void)dummy);
  28. }
  29. return 0;
  30. }