libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

native.pass.cpp (930B)


      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 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // <filesystem>
     13 
     14 // class path
     15 
     16 // const string_type& native() 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()
     27 {
     28   using namespace fs;
     29   const char* const value = "hello world";
     30   { // Check signature
     31     path p(value);
     32     ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native()));
     33     ASSERT_NOEXCEPT(p.native());
     34   }
     35   { // native() is tested elsewhere
     36     path p(value);
     37     assert(p.native() == value);
     38   }
     39 }