[libcxx][modules] protects users from relying on detail headers

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 <__ranges/access.h> instead of
<ranges>, 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.

Differential Revision: https://reviews.llvm.org/D106124
This commit is contained in:
Christopher Di Bella
2022-02-25 18:59:32 +00:00
parent 274ec425dc
commit 5aaefa510e
1147 changed files with 8785 additions and 13 deletions

View File

@@ -17,6 +17,8 @@
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# pragma clang include_instead(<vector>)
# pragma clang include_instead(<deque>)
#endif
_LIBCPP_PUSH_MACROS