Created attachment 49849 [details] working patch to fix the issue #include<filesystem> int main() { } D:\hg\fast_io\.tmp>clang++ -o filesystem filesystem.cc -Ofast -std=c++20 -s In file included from filesystem.cc:1: In file included from D:\msys64\mingw64\include\c++\11.0.0\filesystem:45: D:\msys64\mingw64\include\c++\11.0.0\bits/fs_path.h:252:15: error: invalid use of incomplete type 'std::filesystem::filesystem_error' throw filesystem_error( ^~~~~~~~~~~~~~~~~ D:\msys64\mingw64\include\c++\11.0.0\bits/fs_fwd.h:58:9: note: forward declaration of 'std::filesystem::filesystem_error' class filesystem_error; ^ In file included from filesystem.cc:1: In file included from D:\msys64\mingw64\include\c++\11.0.0\filesystem:45: D:\msys64\mingw64\include\c++\11.0.0\bits/fs_path.h:252:9: error: cannot throw object of incomplete type 'std::filesystem::filesystem_error' throw filesystem_error( ^ ~~~~~~~~~~~~~~~~~ D:\msys64\mingw64\include\c++\11.0.0\bits/fs_fwd.h:58:9: note: forward declaration of 'std::filesystem::filesystem_error' class filesystem_error; ^ 2 errors generated.
Is this possible to fix? Is that anything wrong with the patch I provided?
The bug is already assigned to me so I get emailed about all updates to the bug, so stop CCing my other email addresses. Being annoying does not persuade me to fix things any faster. Quite the opposite in fact. I have not applied your patch because I have a better solution, and because I've been on holiday. I'm not on holiday now, but I'm still going to wait because you're annoying.
(In reply to Jonathan Wakely from comment #2) > The bug is already assigned to me so I get emailed about all updates to the > bug, so stop CCing my other email addresses. > > Being annoying does not persuade me to fix things any faster. Quite the > opposite in fact. > > I have not applied your patch because I have a better solution, and because > I've been on holiday. I'm not on holiday now, but I'm still going to wait > because you're annoying. okay. sorry.
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:57a4f5e4eacfbbbd0ca5f1e3f946c27d63e2b533 commit r11-6676-g57a4f5e4eacfbbbd0ca5f1e3f946c27d63e2b533 Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Jan 14 14:26:19 2021 +0000 libstdc++: Define function to throw filesystem_error [PR 98471] Fix ordering problem on Windows targets where filesystem_error was used before being defined. libstdc++-v3/ChangeLog: PR libstdc++/98471 * include/bits/fs_path.h (__throw_conversion_error): New function to throw or abort on character conversion errors. (__wstr_from_utf8): Move definition after filesystem_error has been defined. Use __throw_conversion_error. (path::_S_convert<_EcharT>): Use __throw_conversion_error. (path::_S_str_convert<_CharT, _Traits, _Allocator>): Likewise. (path::u8string): Likewise.
Should be fixed now.
(In reply to Jonathan Wakely from comment #5) > Should be fixed now. thank you!