llvm-project/libcxx/include
Louis Dionne a34f246899 [libc++][ABI BREAK] Do not use the C++03 emulation for std::nullptr_t by default
We only support Clangs that implement nullptr as an extension in C++03 mode,
and we don't support GCC in C++03 mode. Hence, this patch disables the
use of the std::nullptr_t emulation in C++03 mode by default. Doing that
is technically an ABI break since it changes the mangling for std::nullptr_t.
However:

(1) The only affected users are those compiling in C++03 mode that have
    std::nullptr_t as part of their ABI, which should be reasonably rare.

(2) Those users already have a lingering problem in that their code will
    be incompatible in C++03 and C++11 modes because of that very ABI break.
    Hence, the only users that could really be inconvenienced about this
    change is those that planned on compiling in C++03 mode forever - for
    other users, we're just breaking them now instead of letting them break
    themselves later on when they try to upgrade to C++11.

(3) The ABI break will cause a linker error since the mangling changed,
    and will not result in an obscure runtime error.

Furthermore, if anyone is broken by this, they can define the
_LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION macro to return to the
previous behavior. We will then remove that macro after shipping
this for one release if we haven't seen widespread issues.

Concretely, the motivation for making this change is to make our own ABI
consistent in C++03 and C++11 modes and to remove complexity around the
definition of nullptr.

Furthermore, we could investigate making nullptr a keyword in C++03 mode
as a Clang extension -- I don't think that would break anyone, since
libc++ already defines nullptr as a macro to something else. Only users
that do not use libc++ and compile in C++03 mode could potentially be
broken by that.

Differential Revision: https://reviews.llvm.org/D109459
2021-11-30 06:01:45 -05:00
..
__algorithm [libc++] Test that our algorithms never copy a user-provided comparator. 2021-11-19 15:03:24 -05:00
__bit [libc++] Implement P1272R4 (std::byteswap) 2021-11-22 01:28:18 +01:00
__charconv [libc++] Adds (to|from)_chars_result operator==. 2021-11-19 16:29:33 +01:00
__compare [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
__concepts [libc++] Remove an unused internal concept. 2021-09-02 19:27:49 +02:00
__coroutine [libc++] Remove _LIBCPP_HAS_NO_SPACESHIP_OPERATOR 2021-11-17 10:59:57 -05:00
__format [libc++][nfc] Move functions to a generic place. 2021-11-19 16:38:35 +01:00
__functional [libc++] Always define a key function for std::bad_function_call in the dylib 2021-11-16 11:23:27 -08:00
__iterator [libcxx] Implement three-way comparison for std::reverse_iterator 2021-11-26 10:12:19 +00:00
__memory [libc++] Value-initialize unique_ptr's deleter_type 2021-11-24 17:31:34 -05:00
__random [libc++] Granularize the <random> header. NFCI. 2021-11-22 13:24:27 -05:00
__ranges [libc++][NFC] Sort includes in __ranges/concepts.h 2021-11-21 19:34:02 -05:00
__support [SystemZ][z/OS] Fix warnings from unsigned int to long in 32-bit mode 2021-11-16 13:51:35 +00:00
__thread [libc++] Enable <atomic> when threads are disabled 2021-11-17 23:02:58 -05:00
__utility [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
__variant [libc++][NFC] Remove useless _LIBCPP_PUSH_MACROS 2021-08-27 12:41:55 -04:00
experimental [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ext [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
CMakeLists.txt [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
__availability [libc++][format] Add __format_arg_store. 2021-09-01 19:45:02 +02:00
__bit_reference [libc++] __bit_iterator mustn't rely on deprecated SMF generation. 2021-04-26 16:22:42 -04:00
__bits [libc++] Fix some typos and remove unused macros. NFCI. 2021-04-22 12:02:22 -04:00
__bsd_locale_defaults.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
__bsd_locale_fallbacks.h [libc++] Add missing __format__ attributes 2021-11-26 11:03:14 -05:00
__config [libc++][ABI BREAK] Do not use the C++03 emulation for std::nullptr_t by default 2021-11-30 06:01:45 -05:00
__config_site.in [libc++] Add an option to disable wide character support in libc++ 2021-10-12 06:08:23 -04:00
__debug [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
__errc [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
__function_like.h [libc++][NFC] Remove useless _LIBCPP_PUSH_MACROS 2021-08-27 12:41:55 -04:00
__functional_base [libcxx][functional][modular] splices <functional> into modular headers 2021-07-01 14:01:49 -04:00
__hash_table [libc++] Use addressof to fix debug tests. 2021-10-12 18:15:35 +02:00
__libcpp_version [libcxx] Bump __libcpp_version to 14 after branch 2021-07-28 11:07:06 +00:00
__locale [libc++] Add an option to disable wide character support in libc++ 2021-10-12 06:08:23 -04:00
__mbstate_t.h [libc++] Add an option to disable wide character support in libc++ 2021-10-12 06:08:23 -04:00
__mutex_base [libc++][NFCI] Remove uses of _LIBCPP_INLINE_VAR 2021-09-22 16:03:00 -04:00
__node_handle [libc++][NFC] Add missing synopsis for node handles 2021-09-07 15:26:33 -04:00
__nullptr [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
__split_buffer [libc++] Comma-operator-proof a lot of algorithm/container code. 2021-09-08 13:34:01 -04:00
__std_stream [libc++] Alphabetize and include-what-you-use. NFCI. 2021-05-29 19:54:48 -04:00
__string [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
__threading_support [libc++] Enable <atomic> when threads are disabled 2021-11-17 23:02:58 -05:00
__tree [libc++] Use addressof in assignment operator. 2021-10-07 18:10:47 +02:00
__tuple [libc++] Remove workarounds for [[nodebug]] not working properly on typedefs in older Clangs 2021-09-01 10:51:09 -04:00
__undef_macros [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
algorithm [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
any [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
array [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
atomic [libc++] Enable <atomic> when threads are disabled 2021-11-17 23:02:58 -05:00
barrier [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
bit [libc++] Implement P1272R4 (std::byteswap) 2021-11-22 01:28:18 +01:00
bitset [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cassert [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ccomplex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cctype [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cerrno [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cfenv [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cfloat [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
charconv [libc++] Adds (to|from)_chars_result operator==. 2021-11-19 16:29:33 +01:00
chrono [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cinttypes [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ciso646 [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
climits [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
clocale [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cmath [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
codecvt [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
compare [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
complex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
complex.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
concepts [libc++][NFC] Move concepts to a subheader. 2021-09-02 19:22:15 +02:00
condition_variable [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
coroutine [libcxx] [Coroutine] Conform Coroutine Implementation 2021-11-16 14:13:13 +08:00
csetjmp [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
csignal [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstdarg [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstdbool [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstddef [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstdint [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstdio [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstdlib [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cstring [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ctgmath [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ctime [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ctype.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cwchar [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
cwctype [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
deque [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
errno.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
exception [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
execution [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
fenv.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
filesystem [libc++] Avoid overload resolution in path comparison operators 2021-11-25 11:40:55 -05:00
float.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
format [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
forward_list [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
fstream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
functional [libc++] [P1614] Implement std::compare_three_way. 2021-10-10 21:57:10 -04:00
future [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
initializer_list [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
inttypes.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
iomanip [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ios [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
iosfwd [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
iostream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
istream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
iterator [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
latch [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
limits [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
limits.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
list [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
locale [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
locale.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
map [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
math.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
memory [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
module.modulemap [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
mutex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
new [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
numbers [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
numeric [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
optional [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
ostream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
queue [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
random [libc++] Granularize the <random> header. NFCI. 2021-11-22 13:24:27 -05:00
ranges [libc++][NFC] Fix typo in ranges::iterator_t synopsis 2021-11-20 19:15:00 -05:00
ratio [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
regex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
scoped_allocator [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
semaphore [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
set [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
setjmp.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
shared_mutex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
span [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
sstream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stack [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stdbool.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stddef.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stdexcept [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stdint.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stdio.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
stdlib.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
streambuf [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
string [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
string.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
string_view [libc++] Fix constraints for string_view's iterator/sentinel constructor 2021-11-25 11:39:59 -05:00
strstream [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
system_error [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
tgmath.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
thread [libc++] Enable <atomic> when threads are disabled 2021-11-17 23:02:58 -05:00
tuple [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
type_traits [libc++] Remove support for Clang 9 and older. 2021-11-28 15:17:05 +01:00
typeindex [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
typeinfo [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unordered_map [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
unordered_set [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
utility [libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order. 2021-11-22 13:24:28 -05:00
valarray [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
variant [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
vector [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
version [libc++] Implement P1272R4 (std::byteswap) 2021-11-22 01:28:18 +01:00
wchar.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00
wctype.h [runtimes][NFC] Remove filenames at the top of the license notice 2021-11-17 16:30:52 -05:00