1 2 //===----------------------------------------------------------------------===// 3 // 4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 // See https://llvm.org/LICENSE.txt for license information. 6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 // 8 //===----------------------------------------------------------------------===// 9 10 // UNSUPPORTED: c++03 11 12 // <filesystem> 13 14 // class path 15 16 // const value_type* c_str() const noexcept; 17 18 #include "filesystem_include.h" 19 #include <type_traits> 20 #include <cassert> 21 22 #include "test_macros.h" 23 #include "filesystem_test_helper.h" 24 25 main(int,char **)26int main(int, char**) 27 { 28 using namespace fs; 29 const char* const value = "hello world"; 30 const std::string str_value = value; 31 const fs::path::string_type pathstr_value(str_value.begin(), str_value.end()); 32 { // Check signature 33 path p(value); 34 ASSERT_SAME_TYPE(path::value_type const*, decltype(p.c_str())); 35 ASSERT_NOEXCEPT(p.c_str()); 36 } 37 { 38 path p(value); 39 assert(p.c_str() == pathstr_value); 40 assert(p.native().c_str() == p.c_str()); 41 } 42 43 return 0; 44 } 45