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: c++03
10 
11 // <filesystem>
12 
13 // class path
14 
15 // typedef ... value_type;
16 // typedef basic_string<value_type> string_type;
17 // static constexpr value_type preferred_separator = ...;
18 
19 #include "filesystem_include.h"
20 #include <type_traits>
21 #include <cassert>
22 
23 #include "test_macros.h"
24 
25 
main(int,char **)26 int main(int, char**) {
27   using namespace fs;
28 #ifdef _WIN32
29   ASSERT_SAME_TYPE(path::value_type, wchar_t);
30 #else
31   ASSERT_SAME_TYPE(path::value_type, char);
32 #endif
33   ASSERT_SAME_TYPE(path::string_type, std::basic_string<path::value_type>);
34   {
35     ASSERT_SAME_TYPE(const path::value_type, decltype(path::preferred_separator));
36 #ifdef _WIN32
37     static_assert(path::preferred_separator == '\\', "");
38 #else
39     static_assert(path::preferred_separator == '/', "");
40 #endif
41     // Make preferred_separator ODR used by taking its address.
42     const path::value_type* dummy = &path::preferred_separator;
43     ((void)dummy);
44   }
45 
46   return 0;
47 }
48