From 5aaefa510ef055e8f044ca89e352d4313f3aba49 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Fri, 25 Feb 2022 18:59:32 +0000 Subject: [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 , 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 --- libcxx/include/__algorithm/replace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libcxx/include/__algorithm/replace.h') diff --git a/libcxx/include/__algorithm/replace.h b/libcxx/include/__algorithm/replace.h index d0ae8f6..3454403 100644 --- a/libcxx/include/__algorithm/replace.h +++ b/libcxx/include/__algorithm/replace.h @@ -13,6 +13,7 @@ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header +# pragma clang include_instead() #endif _LIBCPP_BEGIN_NAMESPACE_STD -- cgit v1.1