Skip to content

Commit

Permalink
Fix filesystem::weakly_canonical() on Win11 24H2 (#4844)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej authored Jul 21, 2024
1 parent ecbc1ef commit 6c32079
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions stl/inc/xfilesystem_abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ _NODISCARD inline bool __std_is_file_not_found(const __std_win_error _Error) noe
case __std_win_error::_Path_not_found:
case __std_win_error::_Error_bad_netpath:
case __std_win_error::_Invalid_name:
case __std_win_error::_Directory_name_is_invalid: // Windows 11 24H2
return true;
default:
return false;
Expand Down
18 changes: 17 additions & 1 deletion tests/std/tests/P0218R1_filesystem/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3950,7 +3950,7 @@ void test_devcom_953628() { // COMPILE-ONLY
path{S{}};
}

int wmain(int argc, wchar_t* argv[]) {
int run_all_tests(int argc, wchar_t* argv[]) {
error_code ec;

// Store old path and change current path to a temporary path
Expand Down Expand Up @@ -4077,4 +4077,20 @@ int wmain(int argc, wchar_t* argv[]) {
EXPECT(good(ec));

assert(pass);

return 0;
}

int wmain(int argc, wchar_t* argv[]) {
try {
return run_all_tests(argc, argv);
} catch (const filesystem_error& fe) {
cout << "filesystem_error: " << fe.what() << endl;
} catch (const exception& e) {
cout << "exception: " << e.what() << endl;
} catch (...) {
cout << "Unknown exception." << endl;
}

return EXIT_FAILURE;
}

0 comments on commit 6c32079

Please sign in to comment.