llvm-project/libcxx/include
Louis Dionne 8cedff10a1 [libc++] Diagnose when header search paths are set up incorrectly
An issue I often see in codebases compiled for unusual platforms is
that header search paths are specified manually and are subtly wrong.
For example, people will manually add `-isystem <some-toolchain>/usr/include`,
which ends up messing up the layering of header search paths required by
libc++ (because the C Standard Library now appears *before* libc++ in
the search paths). Without this patch, this will end up causing
compilation errors that are pretty inscrutable. This patch aims to
improve the user experience by diagnosing this issue explicitly.

In all cases I can think of, I would expect that a compilation error
occur if these header search paths are not layered properly. This
should only provide an explicit diagnostic instead of failing due
to seemingly unrelated compilation errors.

Differential Revision: https://reviews.llvm.org/D131441
2022-08-17 14:05:26 -04:00
..
__algorithm [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__bit [libc++][NFC] Use concepts in <bit>. 2022-06-13 18:17:48 +02:00
__charconv [libc++] Implements 128-bit support in to_chars. 2022-07-07 17:32:27 +02:00
__chrono Revert "[libcxx] Resolve warnings for Wshift-sign-overflow" 2022-08-17 10:37:24 -07:00
__compare [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__concepts [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__coroutine [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__debug_utils [libc++][ranges] Implement `ranges::shuffle`. 2022-07-22 09:59:13 -07:00
__filesystem [libc++] Implement `operator==` for `filesystem::space_info` 2022-08-08 10:05:47 -07:00
__format [libc++][format] Uglyfies format buffer. 2022-08-17 17:50:24 +02:00
__functional [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__fwd [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__ios [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__iterator [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__memory Revert "[libcxx] Resolve warnings for Wshift-sign-overflow" 2022-08-17 10:37:24 -07:00
__numeric [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
__random [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
__ranges [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__string [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
__support [libcxx] Remove static inline and make use of _LIBCPP_HIDE_FROM_ABI in __support/xlocale/__nop_locale_mgmt.h header 2022-07-23 22:12:37 -04:00
__thread [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__type_traits Revert "[clang] adds unary type transformations as compiler built-ins" 2022-08-14 15:58:21 -04:00
__utility [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__variant [libc++][spaceship] Implement std::variant::operator<=> 2022-08-14 16:16:52 -07:00
experimental [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
ext [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
CMakeLists.txt [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__assert [libc++] Rename __libcpp_assertion_handler to __libcpp_verbose_abort 2022-07-29 13:52:42 -04:00
__availability [libc++] Allow enabling assertions when back-deploying 2022-08-08 08:43:34 -04:00
__bit_reference [libc++] Implement P2417R2 (A more constexpr bitset) 2022-08-14 10:34:01 +02:00
__bits [libc++] Implements 128-bit support in to_chars. 2022-07-07 17:32:27 +02:00
__bsd_locale_defaults.h [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
__bsd_locale_fallbacks.h [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
__config [libc++] Implement P2417R2 (A more constexpr bitset) 2022-08-14 10:34:01 +02:00
__config_site.in [libc++] Treat incomplete features just like other experimental features 2022-07-19 10:50:20 -04:00
__debug [libc++] Make _LIBCPP_DEBUG_RANDOMIZE_RANGE a function 2022-07-03 18:03:44 +02:00
__errc [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
__hash_table [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__locale [libc++][AIX] Correct the definition of __regex_word for AIX 2022-07-16 18:11:04 -04:00
__mbstate_t.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
__mutex_base [libc++][NFC] Replace enable_if with __enable_if_t in a few places 2022-07-04 11:09:34 +02:00
__node_handle [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__split_buffer [libc++] Implement P1004R2 (constexpr std::vector) 2022-07-27 20:26:44 +02:00
__std_stream [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__threading_support [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__tree [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__tuple [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
__undef_macros [libc++] Assume that push_macro and pop_macro are available 2022-05-23 20:47:44 +02:00
__verbose_abort [libc++] Make __libcpp_verbose_abort [[noreturn]] 2022-08-10 10:37:15 -04:00
algorithm [libc++][ranges] Implement `ranges::is_permutation` 2022-08-04 10:54:37 -07:00
any [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
array [libc++][NFC] Replace enable_if with __enable_if_t in a few places 2022-07-04 11:09:34 +02:00
atomic [libc++] Undeprecate ATOMIC_FLAG_INIT (LWG3659) 2022-07-12 08:00:40 +03:00
barrier [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
bit [libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__` 2022-07-14 15:41:46 -04:00
bitset [libc++] Implement P2417R2 (A more constexpr bitset) 2022-08-14 10:34:01 +02:00
cassert [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ccomplex [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cctype [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cerrno [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cfenv [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cfloat [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
charconv [libc++] Granularize some more type_traits 2022-07-24 22:22:12 +02:00
chrono [libc++][chrono] Uses operator<=> in the calendar. 2022-07-27 21:53:08 +02:00
cinttypes [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
ciso646 [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
climits [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
clocale [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cmath [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
codecvt [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
compare [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
complex [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
complex.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
concepts [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
condition_variable [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
coroutine [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
csetjmp [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
csignal [libc++] Fix modules builds when features are removed 2022-06-08 18:48:25 -04:00
cstdarg [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstdbool [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstddef [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cstdint [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cstdio [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cstdlib [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cstring [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
ctgmath [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ctime [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ctype.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
cuchar [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cwchar [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
cwctype [libc++] Diagnose when header search paths are set up incorrectly 2022-08-17 14:05:26 -04:00
deque [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
errno.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
exception [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
execution [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
fenv.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
filesystem [libc++] Implement `operator==` for `filesystem::space_info` 2022-08-08 10:05:47 -07:00
float.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
format [libc++][format] Uglyfies format buffer. 2022-08-17 17:50:24 +02:00
forward_list [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
fstream [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
functional [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
future [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
initializer_list [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
inttypes.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
iomanip [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
ios [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
iosfwd [libc++] Remove macros for IBM compiler 2022-06-14 09:15:41 -04:00
iostream [libc++] Mark standard-mandated includes as such 2022-06-17 20:43:33 +02:00
istream [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
iterator [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
latch [libc++] Make sure that all headers can be included with modules enabled 2022-05-25 03:44:48 -04:00
limits [libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__` 2022-07-14 15:41:46 -04:00
limits.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
list [libc++] Use uninitialized algorithms for vector 2022-07-26 17:44:31 +02:00
locale [libc++] Implement P0618R0 (Deprecating <codecvt>) 2022-06-30 16:47:50 +02:00
locale.h [libc++] Improve error messages for disabled modes 2022-05-20 09:36:55 -04:00
map [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
math.h [libc++] Granularize some more type_traits 2022-07-24 22:22:12 +02:00
memory [libc++] Implement `operator<=>` for `unique_ptr` 2022-08-06 15:09:16 +02:00
module.modulemap.in [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
mutex [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
new [libc++] Implement P0154R1 (Hardware inference size) 2022-06-23 01:31:09 +02:00
numbers [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
numeric [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
optional [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
ostream [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
queue [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
random [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
ranges [libc++] add zip_view and views::zip for C++23 2022-04-25 12:22:22 +02:00
ratio Revert "[libcxx] Resolve warnings for Wshift-sign-overflow" 2022-08-17 10:37:24 -07:00
regex [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
scoped_allocator [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
semaphore [libc++] Make sure that all headers can be included with modules enabled 2022-05-25 03:44:48 -04:00
set [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
setjmp.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
shared_mutex [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
span [libc++] Add a missing assertion in std::span's constructor 2022-08-11 15:31:46 -04:00
sstream [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
stack [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
stdatomic.h [libc++] Remove overly conservative error in <stdatomic.h> 2022-05-16 15:30:01 -04:00
stdbool.h [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
stddef.h [libc++] Remove the ability to use the std::nullptr_t emulation in C++03 mode 2022-02-07 17:51:05 -05:00
stdexcept [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
stdint.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
stdio.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
stdlib.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
streambuf [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
string [libc++] Uses operator<=> in string. 2022-08-14 14:05:05 +02:00
string.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
string_view [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
strstream [libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks 2022-06-21 20:25:04 +02:00
system_error [libc++] Implement `operator<=>` for `error_{code,condition}` 2022-08-15 16:05:53 -07:00
tgmath.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
thread [libc++] Implement `operator<=>` for `thread::id` 2022-08-13 17:30:55 -07:00
tuple [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
type_traits [libc++] Granularize the rest of type_traits 2022-08-14 10:30:48 +02:00
typeindex [libc++] Implement `operator<=>` for `type_index` 2022-08-09 16:35:17 -07:00
typeinfo [libc++] Remove `operator!=` from `type_info` in C++20 2022-08-06 15:10:38 +02:00
uchar.h [libc++] Add missing header <cuchar> 2022-03-07 08:48:50 -05:00
unordered_map [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
unordered_set [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
utility [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
valarray [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
variant [libc++][spaceship] Implement std::variant::operator<=> 2022-08-14 16:16:52 -07:00
vector [libc++][NFC] Replace macros in vector 2022-08-11 20:22:58 +02:00
version [libc++] Implement P2417R2 (A more constexpr bitset) 2022-08-14 10:34:01 +02:00
wchar.h [libc++] Make parameter names consistent and enforce the naming style using readability-identifier-naming 2022-07-08 18:17:47 +02:00
wctype.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00