llvm-project/libcxx
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
..
benchmarks [libc++][format] Adds formatting benchmarks. 2021-11-28 13:12:53 +01:00
cmake Revert "[runtimes] Fix building initial libunwind+libcxxabi+libcxx with compiler implied -lunwind" 2021-11-17 12:50:33 +02:00
docs [libc++][ABI BREAK] Do not use the C++03 emulation for std::nullptr_t by default 2021-11-30 06:01:45 -05:00
include [libc++][ABI BREAK] Do not use the C++03 emulation for std::nullptr_t by default 2021-11-30 06:01:45 -05:00
lib [libc++] Resolve missing table_size symbol 2021-11-18 15:49:45 -05:00
src [libc++] Add missing __format__ attributes 2021-11-26 11:03:14 -05:00
test [libc++] Fix incorrect REQUIRES on a locale-dependent test 2021-11-29 13:42:57 -05:00
utils [libc++] Trigger rebuild of the Docker image so we get a new nightly Clang 2021-11-26 12:57:30 -05:00
.clang-format [libc++] Update clang-format to C++20. 2021-10-30 12:50:57 +02:00
.clang-tidy [libc++] [NFC] Disable clang-tidy's readability-identifier-naming check 2021-11-16 20:14:07 +01:00
.gitignore [libcxx] Fix .gitignore to not exclude test directories 2020-03-25 17:52:23 -07:00
CMakeLists.txt Revert "[runtimes] Fix building initial libunwind+libcxxabi+libcxx with compiler implied -lunwind" 2021-11-17 12:50:33 +02:00
CREDITS.TXT [libc++] Add myself to the credits. 2021-11-28 15:24:45 +01:00
LICENSE.TXT
TODO.TXT [libc++] Disallow volatile types in std::allocator 2021-09-22 11:47:38 -04:00
appveyor-reqs-install.cmd
appveyor.yml