[libcxx-commits] [PATCH] D116146: [libc++] Remove unused headers from <filesystem>

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 22 09:13:58 PST 2021


Mordante accepted this revision.
Mordante added a comment.
This revision is now accepted and ready to land.

LGTM modulo the comments.



================
Comment at: libcxx/include/filesystem:258
 #include <compare>
-#include <cstddef>
-#include <cstdlib>
-#include <iosfwd>
-#include <iterator>
-#include <memory>
-#include <stack>
-#include <string>
-#include <string_view>
-#include <system_error>
-#include <utility>
 #include <version>
 
----------------
Quuxplusone wrote:
> I'm fairly sure you don't need `<version>` in here. Compare to other granularized headers, such as `<compare>` and `<random>`, which don't include it.
> OTOH, `<concepts>`, `<coroutine>`, `<iterator>`, and `<utility>` do include it.
> I guess since we're inconsistent, no action is needed either way right now.
> I can make a followup PR to remove it from everywhere (or, if that fails tests and/or someone's reading of the Standard, to //add// it everywhere).
I think we need version and not depend on other headers providing it. `<version>` makes the feature-test macros available. Some macros are required for `<filesystem>`. For now `<compare>` is fine, until we finish `__cpp_lib_three_way_comparison`, then `<version>` is required. It seems `<random>` is fine not to include it. 

I'll provide a patch for `<compare>`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116146/new/

https://reviews.llvm.org/D116146



More information about the libcxx-commits mailing list