Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filesystem::weakly_canonical() on Win11 24H2 #4844

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}