xref: /llvm-project/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp (revision 31cbe0f240f660f15602c96b787c58a26f17e179)
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 
26 int main(int, char**) {
27   using namespace fs;
28   ASSERT_SAME_TYPE(path::value_type, char);
29   ASSERT_SAME_TYPE(path::string_type, std::basic_string<path::value_type>);
30   {
31     ASSERT_SAME_TYPE(const path::value_type, decltype(path::preferred_separator));
32     static_assert(path::preferred_separator == '/', "");
33     // Make preferred_separator ODR used by taking its address.
34     const char* dummy = &path::preferred_separator;
35     ((void)dummy);
36   }
37 
38   return 0;
39 }
40