Commit Graph

1119 Commits

Author SHA1 Message Date
Stephan T. Lavavej
6f13bfd436 [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-05 00:44:24 +00:00
Stephan T. Lavavej
a5acfb93d4 [libcxx] [test] Consistently list "c++98, c++03" in chronological order. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-05 00:44:19 +00:00
Marshall Clow
db84e0edae Fix shadowing warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 18:21:34 +00:00
Marshall Clow
b3d6031a54 Fix PR33727: std::basic_stringbuf only works with DefaultConstructible allocators. Thanks to Jonathan Wakely for the report and suggested fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 17:31:09 +00:00
Eric Fiselier
4876a73b0a Mark LWG 2942 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-30 22:28:08 +00:00
Stephan T. Lavavej
5d91f314f1 [libcxx] [test] Change comments to say C++ instead of c++. NFC.
This makes them consistent (many comments already used uppercase).

The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:35 +00:00
Stephan T. Lavavej
cf230766ee [libcxx] [test] The entire file futures.shared_future/wait_until.pass.cpp was indented by 1 space. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:27 +00:00
Stephan T. Lavavej
a8d0e52d11 [libcxx] [test] In func.wrap.func.con/alloc_F.pass.cpp, fix REQUIRES whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:25 +00:00
Stephan T. Lavavej
25072f0004 [libcxx] [test] Make files consistently end with newlines, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:22 +00:00
Stephan T. Lavavej
a686caad20 [libcxx] [test] Untabify, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:10 +00:00
Stephan T. Lavavej
62e519c2f9 [libcxx] [test] Strip trailing whitespace, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309463 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:54:49 +00:00
Stephan T. Lavavej
6e76840323 [libcxx] [test] Remove an unused local typedef in enable_shared_from_this.pass.cpp.
Trivial change, committed without review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309322 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 21:16:37 +00:00
Marshall Clow
1fae624dcf Disable the deduction guide test I added in 309296 for the moment, while I figure out which compilers don't support deduction guides
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 18:47:35 +00:00
Marshall Clow
f226a28d61 Implement P0739R0: 'Some improvements to class template argument deduction integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 17:44:03 +00:00
Rachel Craik
24047fd4a7 Remove addtional parameters in function std::next() and std::prev()
Creating a function pointer with proper parameters pointing to std::next() or std::prev() should work.
This change moves the invented paramater for enable_if over to the return type to resolve this QoI issue.

Patch by Jason Liu.

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-24 22:17:05 +00:00
Stephan T. Lavavej
3c00cff599 [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.
Fix D34536.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 22:02:29 +00:00
Stephan T. Lavavej
321617c33d [libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".
Also fixes Clang/LLVM 4.0 (for Windows) error "function-like macro 'TEST_GLIBC_PREREQ' is not defined".

Fixes D34535.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 22:02:25 +00:00
Stephan T. Lavavej
ffc9965e58 [libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".
Fixes D34534.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 22:02:22 +00:00
Eric Fiselier
3f22e24981 Work around PR31864 - ATOMIC_LLONG_LOCK_FREE is incorrect in 32 bit builds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 04:16:50 +00:00
Eric Fiselier
631d697c62 Fix test failure to to new/delete ellisions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-09 22:20:07 +00:00
Casey Carter
8b30287098 optional: Implement LWG 2900 and P0602
Differential Revision: https://reviews.llvm.org/D32385

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-09 17:15:49 +00:00
Eric Fiselier
316bb1188f Fix diagnostic in verify test to match new Clang output
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 23:02:30 +00:00
Marshall Clow
e00d350bbd Fix a bug in regex_Iterator where it would report zero-length matches forever. Reported as http://llvm.org/PR33681. Thanks to Karen Arutyunov for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 16:37:19 +00:00
Eric Fiselier
530ad8eb20 Fix equivalent test on OS X and FreeBSD
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 03:54:38 +00:00
Eric Fiselier
3288eac673 Implement LWG 2937 - equivalent("dne", "exists") is not an error
This patch speculatively implements the PR for LWG 2937, which fixes
two issues with equivalent.

(1) It makes equivalent("dne", "exists") an error. Previously only
    equivalent("dne", "dne") was an error and the former case was not (it returned false).
    Now equivalent reports an error when either input doesn't exist.

(2) It makes equivalent(p1, p2) well-formed when `is_other(p1) && is_other(p2)`.
    Previously this was an error, but there is seemingly no reason why it should be on POSIX system.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@307117 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 03:37:05 +00:00
Akira Hatanaka
c5247b417b Revert "[libcxx] Annotate c++17 aligned new/delete operators with availability"
This reverts commit r306310.

r306310 causes clang to reject a call to an aligned allocation or
deallocation function if it is not implemented in the standard library
of the deployment target. This is not the desired behavior when users
have defined their own aligned functions.

rdar://problem/32664169

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 18:50:23 +00:00
Marshall Clow
a12318f5ae Added failing tests for index out of range for tuple_element<pair<T1,T2>> and variant_alternative<>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 18:18:30 +00:00
Akira Hatanaka
a028f3c8d9 [libcxx] Annotate c++17 aligned new/delete operators with availability
attribute.

This is needed because older versions of libc++ do not have these
operators. If users target an older deployment target and try to compile
programs in which these operators are explicitly called, the compiler
will complain.

The following is the list of minimum deployment targets for the four
OSes:

macosx: 10.13
ios: 11.0
tvos: 11.0
watchos: 4.0

rdar://problem/32664169

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 17:39:48 +00:00
Marshall Clow
3477ae445a Implement inclusive_scan/transform_inclusive_scan for C++17.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-23 05:12:42 +00:00
Stephan T. Lavavej
3497449a37 [libcxx] [test] Fix -Wmismatched-tags in tuple_size_structured_bindings.pass.cpp.
Clang and C1XX both complain about mismatched class/struct, but libc++ and MSVC's STL
differ on what they use for tuple_element/tuple_size, so there's no way to win here.

I'm reverting this part of my previous change. In the future, I'll have to suppress
the warning for one compiler or the other.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 21:10:53 +00:00
Stephan T. Lavavej
b836deb5db [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 21:00:02 +00:00
Stephan T. Lavavej
750da9c572 [libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp and make it friendlier to C1XX.
Style/paranoia: 42.1 doesn't have an exact binary representation. Although this doesn't
cause failures, it makes me uncomfortable, so I'm changing it to 42.5.

C1XX rightly warns about unreferenced variables. Adding tests for their values
makes C1XX happy and improves test coverage.

C1XX (somewhat obnoxiously) warns about seeing a struct specialized as a class.
Although the Standard doesn't care, saying struct consistently is better.
(The Standard itself is still inconsistent about whether to depict tuple_element
and tuple_size as structs or classes.)

Fixes D33953.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 20:34:50 +00:00
Michael Park
b47a9bc6c4 Add a missing SFINAE condition to the variant's converting constructor.
Remarks: This function shall not participate in overload resolution unless
         `is_same_v<decay_t<T>, variant>` is false, unless `decay_t<T>` is
         neither a specialization of `in_place_type_t` nor a specialization of
         `in_place_index_t`, unless `is_constructible_v<Tj, T>` is true, and
         unless the expression `FUN(std::forward<T>(t))` (with `FUN` being the
         above-mentioned set of imaginary functions) is well formed.

Depends on D34111.

Reviewers: EricWF, K-ballo

Reviewed By: EricWF

Subscribers: fhahn

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19 08:25:57 +00:00
Duncan P. N. Exon Smith
2b001ff730 func.wrap.func.con: Fix test comment
This tests moving `function`, not `const function`.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-18 15:34:47 +00:00
Duncan P. N. Exon Smith
10a803db2c any: Add availability for experimental::bad_any_cast
As a follow up to r302172, add missing availability for bad_any_cast.

rdar://problem/32161524

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-18 14:52:26 +00:00
Eric Fiselier
660d2654f8 Allow coroutine_handle<const T> to support creation from const references to the promise_type
It seems conceivable that a user would need to get a coroutine handle
having only a const reference to the promise_type, for example from
within a const member function of the promise.

This patch allows that use case. A coroutine_handle<const T> can be used
in essentially the same way a coroutine_handle<T>, ie to start and destroy
the coroutine. The constness of the promise doesn't/shouldn't propagate
to the handle.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16 00:36:17 +00:00
Marshall Clow
270a04fb06 Renamed some of the newly added tests. No functional change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 05:44:49 +00:00
Marshall Clow
0175dfdfdf Implement the non-parallel versions of reduce and transform_reduce for C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 04:48:45 +00:00
Marshall Clow
246eb897c9 Fix bug 33389 - __is_transparent check requires too much
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 14:34:58 +00:00
Marshall Clow
6bb9569124 Add a test with an empty input range - should do nothing
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 02:28:40 +00:00
Marshall Clow
568c481c7b [array.tuple]/1 says that instantiating tuple_element<N, array<T, M>> is ill-formed if N >= M. We didn't do that. Add a static_assert to cause a failure, and a test that checks that we failed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305191 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:41:37 +00:00
Marshall Clow
fb97c4408f Implement the non-parallel versions of exclusive_scan and transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 02:22:13 +00:00
Stephan T. Lavavej
76836caa7d [libcxx] [test] Update locale names for Windows.
locale.codecvt.byname/ctor_char.pass.cpp:
This test used to use "en_US" as a plain string instead of using platform_support.
Need to fix this because MS STL expects "en-US" instead.

platform_support.h:
These are the legacy Windows locale names. Should use IETF tags instead.
I've also added en_US, since a test was using that as a locale string as well.

msvc_stdlib_force_include.hpp:
Remove _MSVC_STL_VER. The libraries will directly define _MSVC_STL_VERSION in the future.

Fixes D29351.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 18:22:03 +00:00
Stephan T. Lavavej
8ba816b366 [libcxx] [test] Remove a Clang/C2 workaround.
Clang/LLVM doesn't need this workaround.

Fixes D33955.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 18:21:59 +00:00
Eric Fiselier
c597e3867e XFAIL tuple deduction guide test on GCC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 08:03:35 +00:00
Eric Fiselier
3113ac6f85 Add tests for class template deduction on std::tuple.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 07:18:17 +00:00
Eric Fiselier
276a69c18b Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZER
On Bionic PTHREAD_MUTEX_INITIALIZER contains the expression "<enum-type> & <integer-type>",
which causes ADL to perform name lookup for operator&. During this lookup Clang decides
that it requires the default member initializer for std::mutex while defining the DMI
for std::mutex::__m_.

If I'm not mistaken this is caused by the explicit noexcept declaration on the defaulted
constructor.

This patch removes the explicit noexcept and instead allows the compiler to declare
the default constructor implicitly noexcept. It also adds a static_assert to ensure
that happens.

Unfortunatly because it's not easy to change the value of _LIBCPP_MUTEX_INITIALIZER
for a single test there is no good way to test this patch.

The Clang behavior causing the trouble here was introduced in r287713, which first
appears in the 4.0 release.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304942 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 20:47:42 +00:00
Michael Park
3762fe69d2 Implement LWG 2904.
Summary:
- Removed the move-constructibe requirement from copy-assignable.
- Updated `__assign_alt` such that we direct initialize if
  `_Tp` can be `nothrow`-constructible from `_Arg`, or `_Tp`'s
  move construction can throw. Otherwise, construct a temporary and move it.
- Updated the tests to remove the pre-LWG2904 path.

Depends on D32671.

Reviewers: EricWF, CaseyCarter

Reviewed By: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 10:22:43 +00:00
Eric Fiselier
7457967300 Fix test with exceptions disabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 09:06:05 +00:00
Casey Carter
3da9072b08 [test] Test changes to accommodate LWG 2904 "Make variant move-assignment more exception safe"
Also: Move constexpr / triviality extension tests into the std tree and make them conditional on _LIBCPP_VERSION / _MSVC_STL_VERSION.

https://reviews.llvm.org/D32671

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:06:04 +00:00