https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86756
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Thinking further about this, I think <filesystem> should always be installed, but it should only define the portable parts. The enumeration types, filesystem::path, filesystem::filesystem_error and filesystem::directory_entry are all supportable for any hosted implementation. Directory iterators and filesystem operations require OS support, so should be conditionally-supported. The C++17 implementation needs to move from libstdc++fs.a into libstdc++.so anyway, so that simplifies things a little. (In reply to Jonathan Wakely from comment #1) > Same for <experimental/filesystem> and __cpp_lib_experimental_filesystem. It looks like that is already dependent on ENABLE_FILESYSTEM_TS so nothing to do there.