summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix failing -verify tests due to change in Clangs static_assert message.Eric Fiselier2017-09-176-28/+28
| | | | | | | | Clang recently changed the way it outputs static assert diagnostics. This patch fixes libc++'s -verify tests so they tolerate both the old and new message format. llvm-svn: 313499
* Fix accidental ADL in std::allocator_traits meta-programming.Eric Fiselier2017-09-158-0/+84
| | | | | | | | | | | There were a number of cases where __double_underscore functions, for example __has_construct_test, were called without being qualified, causing ADL to occur. This patch qualifies those calls to avoid this problem. Thanks to David L. Jones for point out the issue initially. llvm-svn: 313324
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-101-1/+36
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312892
* Revert "Fix PR34298 - Allow std::function with an incomplete return type."Eric Fiselier2017-09-101-36/+1
| | | | | | | | | | | This reverts commit r312890 because the test case fails to compile for older versions of Clang that reject initializing a const object without a user defined constructor. Since this patch should go into 5.0.1, I want to keep it an atomic change, and will re-commit it with a fixed test case. llvm-svn: 312891
* Fix PR34298 - Allow std::function with an incomplete return type.Eric Fiselier2017-09-101-1/+36
| | | | | | | | | | | | | This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function] whenever the copy constructor or copy assignment operator was required. This patch further constrains that constructor to short circut before evaluating the troublesome SFINAE when `Tp` matches std::function. The original patch is from Alex Lorenz. llvm-svn: 312890
* [test] Cleanup nullopt_t testsCasey Carter2017-08-313-44/+14
| | | | | | | | | | | | | | * Update specification text from N4387 * Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp * is_empty<T> implies is_class<T> * is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context Differential Revision: D37024 llvm-svn: 312256
* [libcxx] [test] Update for C++17 feature removals.Stephan T. Lavavej2017-08-248-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/std/containers/Emplaceable.h test/std/containers/NotConstructible.h test/support/counting_predicates.hpp Replace unary_function/binary_function inheritance with typedefs. test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp test/std/utilities/function.objects/func.require/binary_function.pass.cpp test/std/utilities/function.objects/func.require/unary_function.pass.cpp Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function. test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support. test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp This test doesn't need to be skipped in C++17 mode. Only the construction of std::function from an allocator needs to be skipped in C++17 mode. test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp When testing these reference_wrapper features, unary_function inheritance is totally irrelevant. test/std/utilities/function.objects/refwrap/weak_result.pass.cpp Define and use my_unary_function/my_binary_function to test the weak result type machinery (which is still present in C++17, although deprecated). test/support/msvc_stdlib_force_include.hpp Now we can test C++17 strictly, without enabling removed features. Fixes D36503. llvm-svn: 311705
* [libcxx] [test] Rename _Up to U, etc. NFCI.Stephan T. Lavavej2017-08-114-16/+16
| | | | | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. This performs additional de-uglification, so all of these tests follow the example of iterator.traits/empty.pass.cpp. llvm-svn: 310761
* [libcxx] [test] Rename _Tp to T. NFCI.Stephan T. Lavavej2017-08-117-14/+14
| | | | | | | This improves readability and (theoretically) improves portability, as _Ugly names are reserved. llvm-svn: 310758
* [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.Stephan T. Lavavej2017-08-055-5/+5
| | | | llvm-svn: 310156
* Mark LWG 2942 as completeEric Fiselier2017-07-302-4/+2
| | | | llvm-svn: 309528
* [libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-295-5/+5
| | | | | | | | This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
* [libcxx] [test] In func.wrap.func.con/alloc_F.pass.cpp, fix REQUIRES ↵Stephan T. Lavavej2017-07-291-1/+1
| | | | | | whitespace. NFC. llvm-svn: 309466
* [libcxx] [test] Make files consistently end with newlines, NFC.Stephan T. Lavavej2017-07-294-4/+4
| | | | llvm-svn: 309465
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-2918-57/+57
| | | | llvm-svn: 309464
* [libcxx] [test] Remove an unused local typedef in ↵Stephan T. Lavavej2017-07-271-1/+0
| | | | | | | | enable_shared_from_this.pass.cpp. Trivial change, committed without review. llvm-svn: 309322
* Disable the deduction guide test I added in 309296 for the moment, while I ↵Marshall Clow2017-07-271-0/+4
| | | | | | figure out which compilers don't support deduction guides llvm-svn: 309307
* Implement P0739R0: 'Some improvements to class template argument deduction ↵Marshall Clow2017-07-271-0/+5
| | | | | | integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard llvm-svn: 309296
* Fix test failure to to new/delete ellisionsEric Fiselier2017-07-091-2/+3
| | | | llvm-svn: 307510
* optional: Implement LWG 2900 and P0602Casey Carter2017-07-094-27/+55
| | | | | | Differential Revision: https://reviews.llvm.org/D32385 llvm-svn: 307505
* Added failing tests for index out of range for tuple_element<pair<T1,T2>> ↵Marshall Clow2017-06-282-0/+54
| | | | | | and variant_alternative<> llvm-svn: 306580
* [libcxx] [test] Fix -Wmismatched-tags in ↵Stephan T. Lavavej2017-06-201-2/+4
| | | | | | | | | | | | 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. llvm-svn: 305854
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-06-204-4/+4
| | | | llvm-svn: 305848
* [libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp ↵Stephan T. Lavavej2017-06-201-6/+16
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 305843
* Add a missing SFINAE condition to the `variant`'s converting constructor.Michael Park2017-06-191-0/+14
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 305668
* func.wrap.func.con: Fix test commentDuncan P. N. Exon Smith2017-06-181-1/+1
| | | | | | This tests moving `function`, not `const function`. llvm-svn: 305648
* [libcxx] [test] Remove a Clang/C2 workaround.Stephan T. Lavavej2017-06-081-2/+0
| | | | | | | | Clang/LLVM doesn't need this workaround. Fixes D33955. llvm-svn: 304999
* XFAIL tuple deduction guide test on GCCEric Fiselier2017-06-081-0/+5
| | | | llvm-svn: 304969
* Add tests for class template deduction on std::tuple.Eric Fiselier2017-06-081-0/+150
| | | | llvm-svn: 304967
* Implement LWG 2904.Michael Park2017-06-073-63/+0
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 304891
* Fix test with exceptions disabledEric Fiselier2017-06-071-29/+30
| | | | llvm-svn: 304883
* [test] Test changes to accommodate LWG 2904 "Make variant move-assignment ↵Casey Carter2017-06-075-38/+712
| | | | | | | | | | 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 llvm-svn: 304847
* add missing constexpr to optional::value_orCasey Carter2017-06-061-7/+13
| | | | | | | | [Credit to cpplearner] Differential Revision: https://reviews.llvm.org/D27850 llvm-svn: 304813
* Remove incorrect #ifdef guards around variant tests.Eric Fiselier2017-05-262-4/+2
| | | | | | | | | | | The tests were previously guarded by #if defined(_LIBCPP_VER) || defined(_MSVC_STL_VER), which is both incorrect (e.g. _LIBCPP_VERSION) and unneeded. Although the tests are technically non-standard (yet) they are supported by both libc++ and MSVC's STL. libstdc++ doesn't regularly use the test suite so I'm not concerned about guarding these tests for them. llvm-svn: 303953
* [test] Fix breakage from r303947 =(Casey Carter2017-05-261-2/+4
| | | | llvm-svn: 303951
* [test] make_shared<T()>(...) is, uh, libc++-specificCasey Carter2017-05-261-5/+13
| | | | llvm-svn: 303947
* [test] Workaround C1XX bug in uses_allocator_types.hppCasey Carter2017-05-251-1/+4
| | | | | | | | VSO#109062 "Explicit template argument specification with empty template parameter pack expansion does not imply further empty pack expansion" Differential Revision: https://reviews.llvm.org/D33214 llvm-svn: 303888
* Add support for shared_ptr<FunctionType>Erik Pilkington2017-05-251-1/+12
| | | | | | | | Fixes PR27566. Differential revision: https://reviews.llvm.org/D30837 llvm-svn: 303874
* Add some constexpr tests for optional's move/copy ctorMarshall Clow2017-05-252-0/+27
| | | | llvm-svn: 303824
* Mark the copy constructor and move Marshall Clow2017-05-172-2/+12
| | | | | | constructor to be constexpr. This only works when the contained type has a constexpr copy/move ctor. llvm-svn: 303268
* Cleanup test issues reported by STL @ Microsoft.Eric Fiselier2017-05-123-159/+3
| | | | | | | | | | | This patch cleans up a number of issues reported by STL, including: 1) Fix duplicate is_convertible test. 2) Move non-standard reference_wrapper tests under test/libcxx 3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and wstring_convert tests. llvm-svn: 302870
* Fix or move tests with non-standard assumptionsEric Fiselier2017-05-122-61/+20
| | | | llvm-svn: 302862
* Mark LWG#2782 as complete. No functionality change; we already do this. Just ↵Marshall Clow2017-05-111-1/+7
| | | | | | added a few more tests. llvm-svn: 302802
* Mark LWG#2850 as complete. No functionality change; we had tests that ↵Marshall Clow2017-05-111-1/+2
| | | | | | covered it already. Just added comments to the tests. Thanks to K-ballo for the heads up. llvm-svn: 302799
* Mark LWG#2796 as complete. No functionality change; we had tests that ↵Marshall Clow2017-05-112-0/+8
| | | | | | covered it already. Just added comments to the tests llvm-svn: 302798
* Fix `std::visit` for the zero variants case.Michael Park2017-05-111-0/+10
| | | | | | | | | | | | | | | | | Summary: The following code is broken: ``` std::visit([]{}); ``` Reviewers: EricWF Reviewed By: EricWF Differential Revision: https://reviews.llvm.org/D33090 llvm-svn: 302773
* Remove usages of _LIBCPP_MSVC which is never definedEric Fiselier2017-05-101-1/+1
| | | | llvm-svn: 302736
* Implement LWG 2591 - Patch from K-BalloEric Fiselier2017-05-101-0/+4
| | | | llvm-svn: 302724
* XFAIL is_trivially_copyable test for compilers that don't implement Core 2094Eric Fiselier2017-05-101-1/+3
| | | | llvm-svn: 302723
* Fix enable_shared_from_this test in C++11Eric Fiselier2017-05-101-7/+6
| | | | llvm-svn: 302721
OpenPOWER on IntegriCloud