llvm-project/libcxx
Louis Dionne d4c39f1ab9 [libc++] Add workaround to avoid breaking users of <span> when <ranges> are disabled
Back in 3a208c6894, we implemented the range-based constructor for <span>.
However, in doing so, we removed a previous non-standard constructor that
we provided before shipping <ranges>. Unfortunately, that breaks code that
was relying on a range-based constructor until we ship all of <ranges>.

This patch reintroduces the old non-conforming constructors and tests
that were removed in 3a208c6894 and uses them whenever <ranges> is
not provided (e.g. in LLVM 14). This is only a temporary workaround
until we enable <ranges> by default in C++20, which should hopefully
happen by LLVM 15.

The goal is to cherry-pick this workaround back to the LLVM 14 release
branch, since I suspect the constructor removal may otherwise cause
breakage out there, like the breakage I saw internally.

We could have avoided this situation by waiting for C++20 to be finalized
before shipping std::span. For example, we could have guarded it with
something like _LIBCPP_HAS_NO_INCOMPLETE_RANGES to prevent users from
accidentally starting to depend on it before it is stable. We did not
have these mechanisms when std::span was first implemented, though.

Differential Revision: https://reviews.llvm.org/D121626
2022-03-15 16:36:33 -04:00
..
benchmarks [libc++] Don't manually override NDEBUG in the dylib build 2022-03-09 10:05:38 -05:00
cmake [libcxx] Add an explicit option to build against system-libcxxabi 2022-03-01 13:44:56 -05:00
docs [libc++][ranges] Implement ranges::find{, _if, _if_not} 2022-03-12 01:46:02 +01:00
include [libc++] Add workaround to avoid breaking users of <span> when <ranges> are disabled 2022-03-15 16:36:33 -04:00
lib [runtimes] Remove FOO_TARGET_TRIPLE, FOO_SYSROOT and FOO_GCC_TOOLCHAIN 2022-03-01 08:39:42 -05:00
src [libc++] Fix double file closing in `std::filesystem::remove_all()`. 2022-02-28 12:56:36 -05:00
test [libc++] Add workaround to avoid breaking users of <span> when <ranges> are disabled 2022-03-15 16:36:33 -04:00
utils [libc++] Update URL to old libc++ dylibs 2022-03-15 16:18:51 -04:00
.clang-format [libc++] Update clang-format to C++20. 2021-10-30 12:50:57 +02:00
.clang-tidy [libc++] Enable more clang-tidy checks and list potential candidates 2022-03-08 14:14:55 +01:00
.gitignore
CMakeLists.txt [libc++] Don't manually override NDEBUG in the dylib build 2022-03-09 10:05:38 -05:00
CREDITS.TXT Microsoft's floating-point to_chars powered by Ryu and Ryu Printf 2021-12-12 16:34:50 +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