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++98, c++03 11 12 // <filesystem> 13 14 // class path 15 16 // const value_type* c_str() const noexcept; 17 18 #include "filesystem_include.hpp" 19 #include <type_traits> 20 #include <cassert> 21 22 #include "test_macros.h" 23 #include "filesystem_test_helper.hpp" 24 25 26 int main(int, char**) 27 { 28 using namespace fs; 29 const char* const value = "hello world"; 30 const std::string str_value = value; 31 { // Check signature 32 path p(value); 33 ASSERT_SAME_TYPE(path::value_type const*, decltype(p.c_str())); 34 ASSERT_NOEXCEPT(p.c_str()); 35 } 36 { 37 path p(value); 38 assert(p.c_str() == str_value); 39 assert(p.native().c_str() == p.c_str()); 40 } 41 42 return 0; 43 } 44