Commit Graph

4385 Commits

Author SHA1 Message Date
Eric Fiselier
d316c2b7fc Fix min/max usage in variant
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 04:57:22 +00:00
Eric Fiselier
e7f8cd476d [libc++] Shrink variant's index type when possible
Summary:
Currently `std::variant` always uses an unsigned int to store the variant index. However this isn't nessesary and causes `std::variant` to be larger than it needs to be in most cases.

This patch changes the index type to be `unsigned char` when possible, and `unsigned short` or `unsigned int` otherwise, depending on the size (Although it's questionable if it's even possible to create a variant with 65535 elements.

Unfortunately this change is an ABI break, and as such is only enabled in ABI v2.

Reviewers: mpark

Reviewed By: mpark

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 04:19:44 +00:00
Eric Fiselier
115071a08e Fix nodiscard test when modules are enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-19 03:50:35 +00:00
Marshall Clow
4bf7f4c1e8 Mark free functions size/empty/data conditionally noexcept.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 17:55:41 +00:00
Marshall Clow
bc6989bcbd More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in filesystem::path
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 05:48:32 +00:00
Marshall Clow
79f3f9dbed More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in match_results. <regex>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 04:48:34 +00:00
Marshall Clow
f1729d90b3 More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:02:27 +00:00
Casey Carter
3fdfbbfe34 [test] Alignment must be > __STDCPP_DEFAULT_NEW_ALIGNMENT__ to call aligned new
Differential Revision: D39221

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 19:14:45 +00:00
Marshall Clow
37b5a6b495 Clean up the tests for free data(), size() and empty()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318313 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 17:47:09 +00:00
Billy Robert O'Neal III
b981667776 Tolerate even more [[nodiscard]] in the STL. Reviewed as https://reviews.llvm.org/D39080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 07:45:07 +00:00
Billy Robert O'Neal III
9ae62c79cc Tolerate [[nodiscard]] annotations in the STL. Reviewed as https://reviews.llvm.org/D39033
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 07:40:37 +00:00
Marshall Clow
88626bf496 First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 05:51:26 +00:00
Marshall Clow
2645a49a67 Still more missing tests - this time for the unordered containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 05:25:36 +00:00
Marshall Clow
0b07da7c85 Named the macro wrong in the test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 03:08:39 +00:00
Marshall Clow
4f009913df More missing tests - array<>::size() and array<>::max_size()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 02:31:14 +00:00
Eric Fiselier
6f8459857e Update Appveyor LLVM install link to be current and non-broken
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 01:37:11 +00:00
Marshall Clow
a17cd7c641 Added tests for xxx.size() and xxx.empty() for all the sequence containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 01:33:33 +00:00
Marshall Clow
c9f5f10562 Add two new macros: _LIBCPP_NODISCARD_AFTER_CXX17 and _LIBCPP_CONSTEXPR_AFTER_CXX17, along with a way to turn off the NODISCARD one: _LIBCPP_DISABLE_NODISCARD_AFTER_CXX17. No one is using these yet, but we will be ... soon
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 22:26:50 +00:00
Alexander Richardson
e208d0895a Rename identifiers named __output
Summary:
In the CHERI clang compiler __output and __input are keywords and therefore
we can't compile libc++ with our compiler.

Reviewers: mclow.lists, EricWF, theraven

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 11:14:25 +00:00
Marshall Clow
8437dbd021 Another test for LWG2952
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:18:36 +00:00
Marshall Clow
52728778fa Implement LWG2950: std::byte operations are misspecified
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318125 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 01:14:53 +00:00
Marshall Clow
e1cfe7a7f6 Implement LWG2952: iterator_traits should work for pointers to cv T
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 00:03:10 +00:00
Marshall Clow
928f2866ec Put the status in the wrong column
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 04:15:39 +00:00
Marshall Clow
edd7e051d4 Implement P0550R2: Transformation Trait remove_cvref
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 03:59:22 +00:00
Marshall Clow
7513814cb6 Two more papers from Albuquerque
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12 18:52:16 +00:00
Marshall Clow
55eda5dfcc Updated C++2a status page with new features/defects approved in Albuquerque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-12 18:48:42 +00:00
Alex Lorenz
b4a34c08ac Add _LIBCPP_INLINE_VISIBILITY to __compressed_pair_elem members
The commit r300140 changed the implementation of compressed_pair, but didn't add
_LIBCPP_INLINE_VISIBILITY to the constructors and get members of the
compressed_pair_elem class. This patch adds the visibility annotation.

I didn't find a way to test this change with libc++ regression tests.

rdar://35352579

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09 17:54:49 +00:00
Volodymyr Sapsai
eada02443a [libcxx] Mark test cxa_deleted_virtual.pass.cpp as failing for previous libcxx versions.
r313500 added a fix for undefined "___cxa_deleted_virtual" symbol.
Previous libcxx versions don't have the fix and corresponding test
should be failing.

rdar://problem/34521053

Reviewers: EricWF, mclow.lists, ahatanak

Reviewed By: ahatanak

Subscribers: mehdi_amini, cfe-commits

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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317734 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 22:30:29 +00:00
Marshall Clow
56a3f4a9d1 Added include for <cassert>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 20:25:47 +00:00
Eric Fiselier
7e73ea873f Teach test suite about C++2a dialect flag.
This patch teaches the test suite configuration about the -std=c++2a
flag. And, since it's the newest dialect, change the test suite to
choose it, if possible, by default.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:26:23 +00:00
Eric Fiselier
6efb1c19a7 Change test suite to support c++17 dialect flag instead of c++1z.
This patch changes the test suite to attempt and prefer -std=c++17 over
-std=c++1z. It also fixes the REQUIRES and UNSUPPORTED lit markers
to refer to c++17 over c++1z.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:20:58 +00:00
Marshall Clow
2e390822e5 Change a bunch of comments from C++1z to C++17. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317212 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 15:03:25 +00:00
Roger Ferrer Ibanez
79078a328e Mark tests as unsupported in C++98 as well
Differential Revision: https://reviews.llvm.org/D38362



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 15:01:43 +00:00
Marshall Clow
e3853bfecd Mark Endian as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 14:53:08 +00:00
Dan Albert
c3f25abd63 Revert "[libc++] Don't alias quick_exit if __ANDROID_API__ < 21"
Broke the Darwin build bots.

This reverts commit f56f1bba1a.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 23:43:07 +00:00
Dan Albert
f56f1bba1a [libc++] Don't alias quick_exit if __ANDROID_API__ < 21
Summary:
quick_exit() and at_quick_exit() were introduced in android NDK 21:
https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/stdlib.h#55

This CL conditions `_LIBCPP_HAS_QUICK_EXIT` on `__ANDROID_API__ >= 21`.  The only place this macro is used is in some using declarations: `using ::quick_exit`, `using ::at_quick_exit`.

Also, add a missing include to sys/cdefs.h which is what defines `__BIONIC__`.

Reviewers: thakis, danalbert, EricWF

Reviewed By: danalbert

Subscribers: srhines, krytarowski

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 21:17:56 +00:00
Marshall Clow
d422c95317 More statuses, a new patch, too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 04:03:35 +00:00
Marshall Clow
9a675c6dae Update the synopsis to match the P/R of 2945. No code changes.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@317063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-01 01:27:25 +00:00
Marshall Clow
67371161a0 Fix broken links; update more issues.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-31 00:19:47 +00:00
Marshall Clow
c6934a38d5 Add a fail test for aligned_union of an incomplete type. See LWG#2979. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-31 00:05:17 +00:00
Marshall Clow
772a6d4185 Add more fuzzing bits: partial_sort_copy, partition_copy, unique, unique_copy. No functional change to libc++; this is all test infastructure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 19:51:58 +00:00
Eric Fiselier
a4c272d82f Implement LWG 3013 - some filesystem members should not be noexcept.
LWG 3013 points out that the constructors and increment members
of the directory iterators need to allocate, and therefore cannot
be marked noexcept.

It also points out that `is_empty` and `copy` likely need to allocate
as well, and as such can also not be noexcept.

This patch speculatively implements the resolution removing noexcept,
because libc++ does indeed have the possibility of throwing on allocation
failure.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 18:59:59 +00:00
Eric Fiselier
fba9cd8c9e Fix PR35078 - recursive directory iterator's increment method throws incorrectly.
The guts of the increment method for recursive_directory_iterator
was failing to pass an error code object to calls to status/symlink_status,
which can throw under certain conditions.

This patch fixes the issues by correctly propagating the error codes.
However the noexcept still needs to be removed from the signature, as
mentioned in LWG 3014, but that change will be made in a separate commit.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 18:43:21 +00:00
Marshall Clow
3b8f03d964 Mark test as unsupported on C++98/03, since it uses move_iterator
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 16:07:59 +00:00
Marshall Clow
c3fa9655a4 Fix PR#35119 : set_union misbehaves with move_iterators. Thanks to Denis Yaroshevskiy for both the bug report and the fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 15:50:00 +00:00
Marshall Clow
9bc42cf1d7 Initial triage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-29 21:57:58 +00:00
Marshall Clow
a12eafc284 Update status of 2950
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-29 21:43:30 +00:00
Marshall Clow
23d0bd265d Issues to be voted on in ABQ
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-29 19:02:00 +00:00
Marshall Clow
76929f6825 Mark string_view's constructor from (ptr,len) as noexcept (an extension). Update the tests to check this (and other noexcept bits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 16:30:06 +00:00
Marshall Clow
66db4e4fdd Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K for the bug report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 14:06:00 +00:00