Skip to content

Commit 6c32079

Browse files
Fix filesystem::weakly_canonical() on Win11 24H2 (#4844)
1 parent ecbc1ef commit 6c32079

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

stl/inc/xfilesystem_abi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ _NODISCARD inline bool __std_is_file_not_found(const __std_win_error _Error) noe
5353
case __std_win_error::_Path_not_found:
5454
case __std_win_error::_Error_bad_netpath:
5555
case __std_win_error::_Invalid_name:
56+
case __std_win_error::_Directory_name_is_invalid: // Windows 11 24H2
5657
return true;
5758
default:
5859
return false;

tests/std/tests/P0218R1_filesystem/test.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3950,7 +3950,7 @@ void test_devcom_953628() { // COMPILE-ONLY
39503950
path{S{}};
39513951
}
39523952

3953-
int wmain(int argc, wchar_t* argv[]) {
3953+
int run_all_tests(int argc, wchar_t* argv[]) {
39543954
error_code ec;
39553955

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

40794079
assert(pass);
4080+
4081+
return 0;
4082+
}
4083+
4084+
int wmain(int argc, wchar_t* argv[]) {
4085+
try {
4086+
return run_all_tests(argc, argv);
4087+
} catch (const filesystem_error& fe) {
4088+
cout << "filesystem_error: " << fe.what() << endl;
4089+
} catch (const exception& e) {
4090+
cout << "exception: " << e.what() << endl;
4091+
} catch (...) {
4092+
cout << "Unknown exception." << endl;
4093+
}
4094+
4095+
return EXIT_FAILURE;
40804096
}

0 commit comments

Comments
 (0)