Commit Graph

128 Commits

Author SHA1 Message Date
Louis Dionne c90dee1e90 [libc++] Re-apply fdc41e11f (LWG1203) without breaking the C++11 build
fdc41e11f was reverted in e46c1def5 because it broke the C++11 build.
We shouldn't be using enable_if_t in C++11, instead we must use
enable_if<...>::type.
2020-09-23 08:56:00 -04:00
Raphael Isemann e46c1def52 Revert "[libc++] Implement LWG1203"
This reverts commit fdc41e11f9. It causes the
libcxx/modules/stds_include.sh.cpp test to fail with:
libcxx/include/ostream:1039:45: error: no template named 'enable_if_t'; did you mean 'enable_if'?
template <class _Stream, class _Tp, class = enable_if_t<

Still investigating what's causing this and reverting in the meantime to get
the bots green again.
2020-09-23 10:13:38 +02:00
Louis Dionne fdc41e11f9 [libc++] Implement LWG1203
Libc++ had an issue where nonsensical code like

  decltype(std::stringstream{} << std::vector<int>{});

would compile, as long as you kept the expression inside decltype in
an unevaluated operand. This turned out to be that we didn't implement
LWG1203, which clarifies what we should do in that case.

rdar://58769296
2020-09-22 17:15:31 -04:00
Louis Dionne 0724f8bf47 [libc++] Implement C++20's P0784 (More constexpr containers)
This commit adds std::construct_at, and marks various members of
std::allocator_traits and std::allocator as constexpr. It also adds
tests and turns the existing tests into hybrid constexpr/runtime tests.

Thanks to Richard Smith for initial work on this, and to Michael Park
for D69803, D69132 and D69134, which are superseded by this patch.

Differential Revision: https://reviews.llvm.org/D68364
2020-09-22 11:20:33 -04:00
zoecarver 3ed89b51da [Take 2] [libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.

This patch was previously reverted in ed653184ac because it was missing
some UNSUPPORTED markup for older compilers. This commit adds it.

Differential Revision: https://reviews.llvm.org/D65721
2020-09-14 18:14:46 -04:00
zoecarver ed653184ac Revert "[libc++] Make rotate a constexpr."
This reverts commit 1ec02efee9.
2020-09-14 14:53:17 -07:00
Nicholas-Baron b552a30283 [libc++] Finish implementing P0202R3
cppreference lists the support for this paper as partial.
I found 4 functions which the paper marks as `constexpr`,
but did not use the appropriate macro.

Differential Revision: https://reviews.llvm.org/D84275
2020-09-14 16:58:49 -04:00
zoecarver 1ec02efee9 [libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D65721
2020-09-14 13:56:48 -07:00
Louis Dionne 316d336dca [libc++] Un-deprecate and un-remove some members of std::allocator
This implements the part of P0619R4 related to the default allocator.
This is incredibly important, since otherwise there is an ABI break
between C++17 and C++20 w.r.t. the default allocator's size_type on
platforms where std::size_t is not the same as std::make_unsigned<std::ptrdiff_t>.
2020-08-28 12:51:51 -04:00
Louis Dionne 2d3b8cc83f [libc++] Implement P0551
Make sure we satisfy the requirements added by P0551, and add tests to
enforce that.
2020-07-13 13:42:26 -04:00
Raul Tambre 4f6c4b473c [libc++] Implement <numbers>
Summary: Constants have 33 significant decimal digits for IEEE 754 128-bit floating-point numbers.

Reviewers: ldionne, #libc, EricWF, zoecarver, curdeius

Reviewed By: ldionne, #libc, curdeius

Differential Revision: https://reviews.llvm.org/D77505
2020-06-19 14:25:02 +05:30
Christopher Di Bella ec789a41e2 [libc++] Add equality for spaceship types for themselves
- Adds operator==(partial_ordering, partial_ordering)
- Adds operator==(weak_ordering, weak_ordering)
- Adds operator==(strong_ordering, strong_ordering)

Differential Revision: https://reviews.llvm.org/D81823
2020-06-18 10:22:50 -04:00
Marek Kurdej d1dbda10ce [libc++] [LWG3201] Update status page: lerp should be marked noexcept.
Summary: Update status page and test synopsis. Add synopsis in <cmath>.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D80456
2020-05-25 22:28:21 +02:00
Marek Kurdej 0c148430cf Reland [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.
Summary:
This LWG issue states that the result of `year_month_day_last::day()` is implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are enabled.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D70346
2020-05-21 21:55:38 +02:00
Marek Kurdej 182adf120c [libc++] [span] [P1976] Update status page. NFC
It was implemented by commit 6d2599e4f7 "[libcxx][span] Implement P1976R2".
2020-05-15 14:35:15 +02:00
Michael Schellenberger Costa ab9f11168f [libcxx][span] Implement solution to LWG-3255
This implements the relaxed requirements on the std::array constructors of span,
where the type only needs to be convertible to the element type of the span.

Note that the previous tests were not sufficient, as the const array<T, n> constructor
was only tested for compile time and the array<T, N> only during runtime.

Restructure the tests so that we can test conversions as well as both constructors.

Differential Revision: https://reviews.llvm.org/D75706
2020-05-14 10:50:44 -04:00
Michael Schellenberger Costa c5ff4031c6 [libcxx][span] Remove const_iterator from std::span
This implements the resolution to LWG-3320.

Differential Revision: https://reviews.llvm.org/D75642
2020-05-14 08:34:32 -04:00
Michael Schellenberger Costa c73a491d10 [libcxx][span] Remove tuple interface
This implements P2116 by removing the tuple interface from std::span.

Differential Revision: https://reviews.llvm.org/D75640
2020-05-14 08:25:49 -04:00
Marek Kurdej ab61fe4150 Revert "[libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion."
This reverts commit e25a2601aa.
It was failing due to _LIBCPP_ASSERT throwing in a method marked noexcept.
2020-05-13 13:16:43 +02:00
Marek Kurdej e25a2601aa [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.
Summary:
This LWG issue states that the result of `year_month_day_last::day()` is implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are enabled.
I am however not aware of the libc++ stand on the desired behaviour.

Reviewers: ldionne, mclow.lists, EricWF, #libc

Reviewed By: ldionne, #libc

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70346
2020-05-13 11:45:55 +02:00
zoecarver df73e36dc6 [libcxx] [NFC] fpos Requirements (p0759r1).
Implements p0759r1. Test-only change. Adds explicit test for table 106 and type checking.

Differential Review: https://reviews.llvm.org/D60491
2020-05-07 14:02:42 -07:00
Marek Kurdej 3e895085de [libc++][P1115][C++20] Improving the Return Value of Erase-Like Algorithms II: Free erase/erase if.
Summary:
This patch adds return type to std::erase and std::erase_if functions.

Also:
* Update __cpp_lib_erase_if to 202002L.
* Fix synopsis in unordered_map.
* Fix generate_feature_test_macro_components.py script.

Reviewers: EricWF, mclow.lists, ldionne, #libc

Reviewed By: ldionne, #libc

Subscribers: broadwaylamb, zoecarver, dexonsmith, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D75905
2020-05-02 14:04:50 +02:00
Marek Kurdej 05343588e3 [libc++] [P0646] Add feature-test macro for __cpp_lib_list_remove_return_type.
Summary: The return type modification has already been implemented in rL364840 and rL365290.

Reviewers: ldionne, mclow.lists, EricWF, #libc!

Reviewed By: ldionne

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70275
2020-03-12 11:06:49 +01:00
Olivier Giroux 54fa9ecd30 [libc++] Implementation of C++20's P1135R6 for libcxx
Differential Revision: https://reviews.llvm.org/D68480
2020-02-24 10:59:35 -05:00
marshall 8424789eec Update last-mod date for libcxx status page 2020-02-16 18:55:50 +01:00
marshall 1a07084f6d Updated with list of papers and issues adopted in Prague 2020-02-16 18:54:28 +01:00
Marek Kurdej e93e58c6c4 Reland [libc++] [P0325] Implement to_array from LFTS with updates.
Fixed expected errors and notes.

Summary:
This patch implements https://wg21.link/P0325.

Reviewers: EricWF, mclow.lists, ldionne, lichray

Reviewed By: ldionne, lichray

Subscribers: lichray, dexonsmith, zoecarver, christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69882
2020-01-31 11:47:18 +01:00
Marek Kurdej 5e7017273f Revert "[libc++] [P0325] Implement to_array from LFTS with updates."
This reverts commit 86aae78268.

A test is failing on "Release" build without assertions enabled (Fedora 31 on x86_64).
2020-01-31 09:45:50 +01:00
Marek Kurdej 86aae78268 [libc++] [P0325] Implement to_array from LFTS with updates.
Summary:
This patch implements https://wg21.link/P0325.
Please mind that at it is my first contribution to libc++, so I may have forgotten to abide to some conventions.

Reviewers: EricWF, mclow.lists, ldionne, lichray

Reviewed By: ldionne, lichray

Subscribers: lichray, dexonsmith, zoecarver, christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69882
2020-01-30 13:38:37 +01:00
Marek Kurdej 76ac1660f7 [libc++] [P0920] [P1661] Update status page. 2019-11-15 00:12:34 +01:00
Louis Dionne 1466335cf4 [libc++][P1872] span should have size_type, not index_type.
Thanks to Marek Kurdej for the patch.

Differential Revision: https://reviews.llvm.org/D70206
2019-11-14 09:07:05 -05:00
Louis Dionne 8b77a3a0f4 [libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.
Thanks to Marek Kurdej for the patch.

Differential Revision: https://reviews.llvm.org/D70221
2019-11-14 08:55:19 -05:00
Marek Kurdej d94f63758a libc++ status page: Fix HTML. 2019-11-13 22:51:29 +01:00
marshall 2f4fb200b6 libc++ status page: New papers and issues adopted in Belfast 2019-11-11 08:13:05 +00:00
Louis Dionne 59e26308e6 [libc++] Take 2: Implement LWG 3158
Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

This was previously committed as r372778 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.

Reviewers: mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65232

llvm-svn: 373092
2019-09-27 15:06:52 +00:00
Ilya Biryukov a3d337a9a7 Revert r372777: [libc++] Implement LWG 2510 and its follow-ups
This also reverts:
 - r372778: [libc++] Implement LWG 3158
 - r372782: [libc++] Try fixing tests that fail on GCC 5 and older
 - r372787: Purge mentions of GCC 4 from the test suite

Reason: the change breaks compilation of LLVM with libc++, for details see
http://lists.llvm.org/pipermail/libcxx-dev/2019-September/000599.html

llvm-svn: 372832
2019-09-25 09:10:38 +00:00
Louis Dionne e9e1c88ed9 [libc++] Implement LWG 3158
Summary:
LWG 3158 marks the allocator_arg_t constructor of std::tuple as
conditionnally explicit based on whether the default constructors
of the tuple's members are explicitly default constructible.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65232

llvm-svn: 372778
2019-09-24 20:22:34 +00:00
Marshall Clow 6e9dfc499d Update c++2a status page with post-Cologne information
llvm-svn: 366696
2019-07-22 15:13:14 +00:00
Zoe Carver a17b1aed6a Add contains method to associative containers. This patch implements P0458R2, adding contains to map, multimap, unordered_map, unordered_multimap, set, multiset, unordered_set, and unordered_multiset.
llvm-svn: 366170
2019-07-16 03:21:01 +00:00
Louis Dionne dfcd4384cb [libc++] Implement P0433: deduction guides for <unordered_map>
Thanks to Arthur O'Dwyer for the patch.

Differential Revision: https://reviews.llvm.org/D58590

llvm-svn: 366124
2019-07-15 20:06:01 +00:00
Marshall Clow fc61db5a3e Update status for bit operations
llvm-svn: 364863
2019-07-01 23:00:34 +00:00
Zhihao Yuan 4513f0f022 [libc++] Recommit r363692 to implement P0608R3
Re-apply the change which was reverted in r363764 as-is after
breakages being resolved.  Thanks Eric Fiselier for working
hard on this.

See also: https://bugs.llvm.org/show_bug.cgi?id=42330

Differential Revision: https://reviews.llvm.org/D44865

llvm-svn: 363993
2019-06-20 22:09:40 +00:00
Marshall Clow d72ebeef2c Mark papers P1458, P1459, P1462 and P1464 as complete. No changed needed to either the library or the tests.
llvm-svn: 363834
2019-06-19 16:32:07 +00:00
Zhihao Yuan 3f0ae625eb [libc++] Revert r363692 which implements P0608R3
The change caused a large number of compiler failures in
Google's codebase.  People need time to evaluate the impact.

llvm-svn: 363764
2019-06-19 07:11:08 +00:00
Zhihao Yuan c74fc6d5f9 [libc++] Implement P0608R3 - A sane variant converting constructor
Summary:
Prefer user-defined conversions over narrowing conversions and conversions to bool.

References:
 http://wg21.link/p0608

Reviewers: EricWF, mpark, mclow.lists

Reviewed By: mclow.lists

Subscribers: zoecarver, ldionne, libcxx-commits, cfe-commits, christof

Differential Revision: https://reviews.llvm.org/D44865

llvm-svn: 363692
2019-06-18 15:26:50 +00:00
Marshall Clow 5347024e28 Update issue statuses. Reviewed as https://reviews.llvm.org/D62932
llvm-svn: 362659
2019-06-05 21:52:19 +00:00
Eric Fiselier 3c9c9ea2c9 Update C++2a status for destroying delete
llvm-svn: 361574
2019-05-24 00:10:33 +00:00
Marshall Clow 98c7c4fad2 Add a test for LWG#3204 and mark it as complete. Reviewed as https://reviews.llvm.org/D61829 Thanks to Zoe for the patch.
llvm-svn: 360586
2019-05-13 14:56:02 +00:00
Marshall Clow 39084db328 Implement LWG 2960: nonesuch is insufficiently useless
llvm-svn: 359526
2019-04-30 00:54:38 +00:00
Marshall Clow fafbddc275 Mark LWG#2977 as 'Nothing to do'. NFC
llvm-svn: 359525
2019-04-30 00:54:26 +00:00