synop.pass.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // UNSUPPORTED: c++98, c++03
  10. // <experimental/filesystem>
  11. // class path
  12. // typedef ... value_type;
  13. // typedef basic_string<value_type> string_type;
  14. // static constexpr value_type preferred_separator = ...;
  15. #include <experimental/filesystem>
  16. #include <type_traits>
  17. #include <cassert>
  18. #include "test_macros.h"
  19. namespace fs = std::experimental::filesystem;
  20. int main() {
  21. using namespace fs;
  22. ASSERT_SAME_TYPE(path::value_type, char);
  23. ASSERT_SAME_TYPE(path::string_type, std::basic_string<path::value_type>);
  24. {
  25. ASSERT_SAME_TYPE(const path::value_type, decltype(path::preferred_separator));
  26. static_assert(path::preferred_separator == '/', "");
  27. // Make preferred_separator ODR used by taking its address.
  28. const char* dummy = &path::preferred_separator;
  29. ((void)dummy);
  30. }
  31. }