[libcxx-commits] [PATCH] D105932: [libcxx][modules] protects users from relying on libc++ detail headers (1/4)

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 13 12:49:16 PDT 2021


cjdb created this revision.
cjdb added a reviewer: ldionne.
cjdb requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: libcxx-commits, sstefan1.
Herald added a project: libc++.
Herald added a reviewer: libc++.

libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as `<__algorithm/find.h>` instead of
`<algorithm>`, and Hyrum's law suggests that users will eventually begin
to rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

This is the first of four patches. Patch #2 will solve the problem for
pre-processor `#include`s; patches #3 and #4 will solve the problem for
`<__tree>` and `<__hash_table>` (since I've never touched the test cases
that are failing for these two, I want to split them out into their own
commits to be extra careful).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105932

Files:
  libcxx/include/module.modulemap
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/types.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105932.358395.patch
Type: text/x-patch
Size: 39396 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210713/33d593c2/attachment-0001.bin>


More information about the libcxx-commits mailing list