Commit Graph

3079 Commits

Author SHA1 Message Date
Eric Fiselier
50f14e23b5 Unbreak green dragon bots w/o __builtin_launder
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349373 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 18:37:59 +00:00
Eric Fiselier
2d0643acea Expect Clang diagnostics in std::launder test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349364 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:56:24 +00:00
Louis Dionne
8f7fa38fb9 [libcxx] Speeding up partition_point/lower_bound/upper_bound
This is a re-application of r345525, which had been reverted by fear of
a regression.

Reviewed as https://reviews.llvm.org/D53994.
Thanks to Denis Yaroshevskiy for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349358 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 16:04:39 +00:00
Michal Gorny
a443a0013d [test] [support] Use socket()+bind() to create unix sockets portably
Replace the mknod() call with socket() + bind() for creating unix
sockets.  The mknod() method is not portable and does not work
on NetBSD while binding the socket should work on all systems supporting
unix sockets.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349305 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 15:12:06 +00:00
Michal Gorny
36feb1b037 [test] [ctime] Ignore -Wformat-zero-length warnings
Explicitly disable the -Wformat-zero-length diagnostic when running
ctime tests, since one of the test cases passes zero-length format
string to strftime().  When strftime() is appropriately decorated
with __attribute__(format, ...), this caused the test to fail because
of this warning (e.g. on NetBSD).

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349294 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-16 09:18:31 +00:00
Eric Fiselier
8c36703b2b Fix static assert diagnostic checks in i386
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349252 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 05:18:56 +00:00
Eric Fiselier
01fac08922 Tolerate Clangs new static_assert messages
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349189 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 20:42:36 +00:00
Louis Dionne
03017b2675 [libcxx] Mark some tests as still failing on macosx10.14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 20:22:44 +00:00
Marshall Clow
f927635d87 Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349178 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-14 18:49:35 +00:00
Louis Dionne
d3f2d5ec4e [libcxx] Fix pop_back() tests to make sure they don't always just pass
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 18:53:17 +00:00
Louis Dionne
f77ee9b3c9 [libcxx] Add assertion in deque::pop_back when popping from an empty deque
Also, add tests making sure that vector and deque both catch the problem
when assertions are enabled. Otherwise, deque would segfault and vector
would never terminate.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348994 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 23:58:25 +00:00
Michal Gorny
f0c3a12346 [test] [depr.c.headers] XFAIL uchar.h on NetBSD
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348973 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:51:46 +00:00
Michal Gorny
13d947cc06 [test] [filesystems] NetBSD can do symlink permissions too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348968 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:28:52 +00:00
Michal Gorny
413329eb35 [test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD
NetBSD also uses tv_sec==-1 as error status indicator, and does not
support setting such a value.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348967 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12 20:20:15 +00:00
Michal Gorny
2d1346288e [test] Permit NetBSD in filesystem_dynamic_test_helper.py
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348872 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 18:29:35 +00:00
Louis Dionne
649e69dd22 [libcxx] Fix test failure on GCC 4.9
GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348850 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 15:27:10 +00:00
Louis Dionne
bca4d67c16 [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

This is a re-application of r348824, which broke the build in C++03 mode
because a test was marked as supported in C++03 when it shouldn't be.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348847 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:22:28 +00:00
Louis Dionne
31355b0538 [libcxx] Fix test on compilers that do not support char8_t yet
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348846 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:15:54 +00:00
Marshall Clow
544d1ba9a3 Fix problems with char8_t stuff on compilers that don't support char8_t yet
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 06:06:49 +00:00
Marshall Clow
96484477d1 Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348828 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 04:35:44 +00:00
Louis Dionne
21a8669ade Revert "[pair] Mark constructors as conditionally noexcept"
This broke the tests on Linux. Reverting until I find out why the tests
are broken (tomorrow).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:32:46 +00:00
Louis Dionne
adde8aeb1c [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:17:23 +00:00
Marshall Clow
49ad9aa8cb Update a couple of vector<bool> tests that were testing libc++-specific bahavior. Thanks to Andrey Maksimov for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348660 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 22:16:26 +00:00
Louis Dionne
f01e82fd42 [libcxx] Remove the availability_markup LIT feature
It is now equivalent to the 'availability' LIT feature, so there's no
reason to keep both.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348653 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 21:48:39 +00:00
Louis Dionne
5fe0a6a0bc [libc++] Improve diagnostics for non-const comparators and hashers in associative containers
Summary:
When providing a non-const-callable comparator in a map or set, the
warning diagnostic does not include the point of instantiation of
the container that triggered the warning, which makes it difficult
to track down the problem. This commit improves the diagnostic by
placing it directly in the body of the associative container.

The same change is applied to unordered associative containers, which
had a similar problem.

Finally, this commit cleans up the forward declarations of several
map and unordered_map helpers, which are not needed anymore.

<rdar://problem/41370747>

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 21:46:17 +00:00
Louis Dionne
55a56d2370 [libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets
The tests were marked to fail based on the 'availability' LIT feature.
However, those tests should really only be failing when we run them
against the dylibs that were deployed on macosx10.7 and macosx10.8,
which the deployment target has nothing to do with.

This caused the tests to unexpectedly pass when running the tests
with deployment target macosx10.{7,8} but running with a recent dylib.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348520 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 19:24:20 +00:00
Louis Dionne
5b19b0bb3f [libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end()
The standard section [array.zero] requires the return value of begin()
and end() methods of a zero-sized array to be unique. Eric Fiselier
clarifies: "That unique value cannot be null, and must be properly aligned".
This patch adds checks for the first part of this clarification: unique
value returned by these methods cannot be null.

Reviewed as https://reviews.llvm.org/D55366.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348509 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 18:24:39 +00:00
Louis Dionne
7ea279fbed [libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
Some people are still running the test suite using AppleClang 9.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348507 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 18:06:47 +00:00
Louis Dionne
edfdc498b8 [libcxx] Make return value of array<T, 0>.data() checked only for libc++
The section array.zero says: "The return value of data() is unspecified".
This patch marks all checks of the array<T, 0>.data() return value as
libc++ specific.

Reviewed as https://reviews.llvm.org/D55364.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 13:52:20 +00:00
Louis Dionne
8bcb9cabcd [libcxx] Mark some tests as failing on macosx 10.14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348437 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 00:25:15 +00:00
Louis Dionne
caae3ec675 [libcxx] Don't depend on availability markup to provide the streams in the dylib
Whether an explicit instantiation declaration should be provided is not
a matter of availability markup.

This problem is exemplified by the fact that some tests were incorrectly
marked as XFAIL when they should instead have been using the definition
of streams from the headers, and hence passing, and that, regardless of
whether visibility annotations are enabled.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348436 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-06 00:24:58 +00:00
Louis Dionne
604afd7688 [libcxx] Implement P0318: unwrap_ref_decay and unwrap_reference
Summary:
This was voted into C++20 in San Diego. Note that there was a revision
D0318R2 which did include unwrap_reference_t, but we mistakingly voted
P0318R1 into the C++20 Working Draft (which does not include
unwrap_reference_t). This patch implements D0318R2, which is what
we'll end up with in the Working Draft once this mistake has been
fixed.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348138 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 14:03:27 +00:00
Marshall Clow
a815a3f8cc First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane. (second try)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347930 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 23:21:18 +00:00
Louis Dionne
8e2d4ad9c5 [libcxx] Make UNSUPPORTED for std::async test more fine grained
The test was previously marked as unsupported on all Apple platforms, when
we really just want to mark it as unsupported for previously shipped dylibs
on macosx.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347920 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 21:25:29 +00:00
Marshall Clow
ebdb54773c Revert commit r347904 because it broke older compilers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347908 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 20:04:47 +00:00
Marshall Clow
50509d15b8 First part of P0482 - Establish that char8_t is an integral type, and that numeric_limits<char8_t> is valid and sane.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 19:49:48 +00:00
Louis Dionne
c28aca18e5 [libcxx] Remove bad_array_length
Summary:
std::bad_array_length was added by n3467, but this never made it into C++.
This commit removes the definition of std::bad_array_length from the headers
AND from the shared library. See the comments in the ABI changelog for details
about the ABI implications of this change.

Reviewers: mclow.lists, dexonsmith, howard.hinnant, EricWF

Subscribers: christof, jkorous, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347903 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 19:44:57 +00:00
Louis Dionne
233c79a96f [libcxx] More fixes to XFAILs for aligned allocation tests for macosx 10.13
Those tests are a real pain to tweak.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347875 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 15:52:36 +00:00
Eric Fiselier
e3e576ae50 Revert "Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF. "
This reverts commit 087f065cb0.

The tests were failing on 32 bit builds, and I don't have time
to clean them up right now. I'll recommit tomorrow with fixed tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 22:24:19 +00:00
Eric Fiselier
cf99ab780c Fix bad _LIBCPP_ALIGNOF test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347790 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:32:16 +00:00
Marshall Clow
7593e799d2 Implement P0966 - string::reserve should not shrink
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347789 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:18:34 +00:00
Eric Fiselier
087f065cb0 Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: EricWF

Subscribers: christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347787 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:16:02 +00:00
Louis Dionne
581671fd26 [libcxx] Remove dynarray
Summary:
std::dynarray had been proposed for C++14, but it was pulled out from C++14
and there are no plans to standardize it anymore.

Reviewers: mclow.lists, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347783 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:02:00 +00:00
Louis Dionne
97c03fb705 [libcxx] Use clang-verify in the lit test suite even when availability is enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347780 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 17:31:17 +00:00
Marshall Clow
f4e307bd3c Implement P1085R2 - Should Span be Regular?. This consists entirely of deletions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347672 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-27 16:35:41 +00:00
Eric Fiselier
f9782def0f Add basic_string::__resize_default_init (from P1072)
This patch adds an implementation of __resize_default_init as
described in P1072R2. Additionally, it uses it in filesystem to
demonstrate its intended utility.

Once P1072 lands, or if it changes it's interface, I will adjust
the internal libc++ implementation to match.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347589 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 20:15:38 +00:00
Louis Dionne
893cf80335 [libcxx] Fix XFAILs for aligned allocation tests
In r339743, I marked several aligned allocation tests as downright
unsupported on macosx in an attempt to unbreak the build. It turns
out that marking them as unuspported whenever we're on OS X is way
too coarse grained. This commit marks the tests as XFAIL with more
granularity.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 19:30:08 +00:00
Louis Dionne
82940003c7 [libcxx] Fix XFAIL for aligned deallocation test with trunk Clang
The test was marked as failing whenever the deployment target was 10.12
or older, but in reality the test passes when the deployment target is
10.12 on recent Clangs. This happens because only older clangs do not
honor the -faligned-allocation flag, which disables any availability
error related to aligned allocation support, regardless of the
deployment target.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347580 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 17:47:16 +00:00
Louis Dionne
8008cf5287 [libcxx] Use a type that is always an aggregate in variant's tests
Summary:
In PR39232, we noticed that some variant tests started failing in C++2a mode
with recent Clangs, because the rules for literal types changed in C++2a. As
a result, a temporary fix was checked in (enabling the test only in C++17).

This commit is what I believe should be the long term fix: I removed the
tests that checked constexpr default-constructibility with a weird type
from the tests for index() and valueless_by_exception(), and instead I
added tests for those using an obviously literal type in the test for the
default constructor.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, arphaman, libcxx-commits, rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347568 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-26 16:14:56 +00:00
Louis Dionne
09861dbf93 [NFC] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-22 19:10:28 +00:00