Merge branch 'feature-200-fstream-test'

This commit is contained in:
Steffen Schümann 2026-07-11 21:22:43 +02:00
commit 6dfddd981e
6 changed files with 30 additions and 0 deletions

View File

@ -239,6 +239,7 @@ you might use:
#ifdef GHC_USE_STD_FS
#include <filesystem>
#include <fstream>
namespace fs {
using namespace std::filesystem;
using ifstream = std::ifstream;
@ -318,6 +319,7 @@ switching like this:
#ifdef GHC_USE_STD_FS
#include <filesystem>
#include <fstream>
namespace fs {
using namespace std::filesystem;
using ifstream = std::ifstream;

View File

@ -58,6 +58,7 @@
#ifdef GHC_USE_STD_FS
#include <filesystem>
#include <fstream>
namespace fs {
using namespace std::filesystem;
using ifstream = std::ifstream;

View File

@ -60,6 +60,7 @@
#ifdef GHC_USE_STD_FS
#include <filesystem>
#include <fstream>
namespace fs {
using namespace std::filesystem;
using ifstream = std::ifstream;

View File

@ -97,6 +97,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
endif()
add_test(fwd_impl_test fwd_impl_test)
if("cxx_std_17" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
add_executable(fs_std_header_test fs_std_header_test.cpp fs_std_fwd_header_test.cpp)
target_link_libraries(fs_std_header_test ghc_filesystem)
target_compile_features(fs_std_header_test PRIVATE cxx_std_17)
SetTestCompileOptions(fs_std_header_test)
add_test(fs_std_header_test fs_std_header_test)
endif()
add_executable(exception exception.cpp)
if(MSVC)
# MSVC 2015 warns for noexcept declarations when exception handling is disabled.

View File

@ -0,0 +1,8 @@
#define GHC_USE_STD_FS
#include <ghc/fs_std_fwd.hpp>
bool fs_std_fwd_header_test()
{
fs::fstream stream;
return stream.is_open();
}

View File

@ -0,0 +1,10 @@
#define GHC_USE_STD_FS
#include <ghc/fs_std.hpp>
bool fs_std_fwd_header_test();
int main()
{
fs::ifstream stream;
return stream.is_open() || fs_std_fwd_header_test() ? 1 : 0;
}