summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix shadowing warning. Patch from STL@microsoft.comEric Fiselier2016-10-231-1/+1
| | | | llvm-svn: 284941
* [libcxx] Support std::regex_constants::match_not_nullTim Shen2016-10-211-0/+46
| | | | | | | | | | | | Summary: Fixes PR21597. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25595 llvm-svn: 284881
* Adding a missing constexpr test for reverse_iterator operator[].Marshall Clow2016-10-201-0/+11
| | | | llvm-svn: 284731
* Attempt to workaround XPASS for aligned allocation testsEric Fiselier2016-10-204-4/+8
| | | | llvm-svn: 284691
* Implement constexpr support for reverse_iterator. Reviewed as ↵Marshall Clow2016-10-1923-23/+366
| | | | | | https://reviews.llvm.org/D25534 llvm-svn: 284602
* Make any_cast<void()>(nullptr) compileEric Fiselier2016-10-161-0/+13
| | | | llvm-svn: 284333
* Update LWG 2767 and add test caseEric Fiselier2016-10-161-0/+14
| | | | llvm-svn: 284324
* Update status for std::optional LWG issues and fix an optional SFINAE bugEric Fiselier2016-10-162-0/+15
| | | | llvm-svn: 284323
* Update issue status for LWG 2744Eric Fiselier2016-10-164-17/+25
| | | | llvm-svn: 284322
* Update issue status for LWG 2768 and 2769Eric Fiselier2016-10-164-42/+72
| | | | llvm-svn: 284321
* Implement LWG 2712 and update other issues statusEric Fiselier2016-10-161-2/+26
| | | | llvm-svn: 284318
* Implement LWG 2681 and 2682Eric Fiselier2016-10-161-0/+41
| | | | llvm-svn: 284316
* Implement LWG 2672.Eric Fiselier2016-10-151-0/+29
| | | | llvm-svn: 284314
* Implement modified LWG 2665Eric Fiselier2016-10-151-0/+8
| | | | llvm-svn: 284313
* Prevent new/delete replacement tests from being optimized away.Eric Fiselier2016-10-147-37/+31
| | | | llvm-svn: 284289
* Clarify XFAIL commentsEric Fiselier2016-10-142-2/+4
| | | | llvm-svn: 284282
* XFAIL aligned allocation tests for older Clang versionsEric Fiselier2016-10-148-18/+28
| | | | llvm-svn: 284214
* XFAIL aligned allocation test failures with UBSANEric Fiselier2016-10-144-9/+10
| | | | llvm-svn: 284210
* Add void_t and invoke feature test macrosEric Fiselier2016-10-142-0/+75
| | | | llvm-svn: 284209
* Implement P0035R4 -- Add C++17 aligned allocation functionsEric Fiselier2016-10-1411-0/+845
| | | | | | | | | | | | | | | | Summary: This patch implements the library side of P0035R4. The implementation is thanks to @rsmith. In addition to the C++17 implementation, the library implementation can be explicitly turned on using `-faligned-allocation` in all dialects. Reviewers: mclow.lists, rsmith Subscribers: rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D25591 llvm-svn: 284206
* Implement http://wg21.link/p0302r1: Removing Allocator Support in ↵Marshall Clow2016-10-1312-0/+210
| | | | | | std::function. These functions never worked, and as far as I know, no one ever called them. llvm-svn: 284164
* Add missing include in test; NFC. Thanks to Jonathan Wakely for the report.Marshall Clow2016-10-131-0/+1
| | | | llvm-svn: 284120
* Disable trivial pair copy/move tests when unsupportedDimitry Andric2016-10-121-0/+6
| | | | | | | | | | | | | | | | | | Summary: On FreeBSD, for ABI compatibility reasons, the pair trivial copy constructor is disabled, using the aptly-named `_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR` define. Disable the related tests when this define is on, so they don't fail unexpectedly. Reviewers: emaste, rsmith, theraven, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25449 llvm-svn: 284047
* Remove usages of _LIBCPP_CONSTEXPR under test/stdEric Fiselier2016-10-125-16/+26
| | | | llvm-svn: 284002
* Remove usages of _ALIGNAS_TYPEEric Fiselier2016-10-125-5/+15
| | | | llvm-svn: 283999
* Remove use of _VSTD::__invoke in the not_fn testsEric Fiselier2016-10-121-1/+4
| | | | llvm-svn: 283991
* Implement N4606 optionalEric Fiselier2016-10-1273-1/+6357
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional. - Update relational operators per http://wg21.link/P0307 - Update to requirements of http://wg21.link/P0032 - Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable. Audit P/Rs for optional LWG issues: - 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R). - 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression. - 2740 "constexpr optional<T>::operator->" Already conforming. - 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented. - 2748 "swappable traits for optionals" Already conforming. - 2753 "Optional's constructors and assignments need constraints" Implemented. Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey! Reviewers: mclow.lists, CaseyCarter, EricWF Differential Revision: https://reviews.llvm.org/D22741 llvm-svn: 283980
* Revert Add <optional>. Will recommit with better commit messageEric Fiselier2016-10-1273-6347/+1
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-1273-1/+6347
| | | | | | | | This patch is largely thanks to Casey Carter @ Microsoft. He did the initial work of porting our experimental implementation and tests over to namespace std. llvm-svn: 283977
* Fix two more tests that hang when testing against libstdc++Eric Fiselier2016-10-122-0/+6
| | | | llvm-svn: 283976
* Prevent the test suite from hanging when run against libstdc++Eric Fiselier2016-10-121-0/+5
| | | | llvm-svn: 283975
* Fix LWG2683 - filesystem::copy() should always clear the user-provided ↵Eric Fiselier2016-10-111-5/+27
| | | | | | error_code llvm-svn: 283951
* Fix incorrect exception handling behavior in the uninitialized algorithmsEric Fiselier2016-10-115-24/+14
| | | | llvm-svn: 283941
* Add tests to check that swap(std::function, std::function) is noexcept. This ↵Marshall Clow2016-10-101-1/+14
| | | | | | is LWG#2062, but we already do this. No changes to the library, just adding tests. llvm-svn: 283780
* Add tests for LWG2544. We already implement this; just adding tests to make ↵Marshall Clow2016-10-103-0/+66
| | | | | | sure that we keep doing it. llvm-svn: 283749
* Provide a constexpr addressof with GCC 7.Eric Fiselier2016-10-101-1/+1
| | | | | | | | | | | | | | | | __builtin_addressof was added to the GCC trunk in the past week. This patch teaches libc++ about it so it can correctly provide constexpr addressof. Unfortunately this patch will break users of earlier GCC 7 builds, since we expect __builtin_addressof but one won't be provided. One option would be to only use __builtin_addressof for GCC 7.1 and above, but that means waiting for another release. Instead I've specifically chosen to break older GCC 7 versions. Since GCC 7 has yet to be released, and the 7.0 release is a development release, I believe that anybody currently using GCC 7.0 will have no issue upgrading. llvm-svn: 283715
* Remove all _LIBCPP_VERSION tests from under test/stdEric Fiselier2016-10-087-44/+0
| | | | llvm-svn: 283644
* Purge all usages of _LIBCPP_STD_VER under test/std/algorithmEric Fiselier2016-10-0817-121/+132
| | | | llvm-svn: 283643
* Add missing <memory> include in testEric Fiselier2016-10-081-0/+1
| | | | llvm-svn: 283633
* [libc++] Fix stack_allocatorEric Fiselier2016-10-0831-135/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To quote STL the problems with stack allocator are" >"stack_allocator<T, N> is seriously nonconformant to N4582 17.6.3.5 [allocator.requirements]. > First, it lacks a rebinding constructor. (The nested "struct rebind" isn't sufficient.) > Second, it lacks templated equality/inequality. > Third, it completely ignores alignment. > Finally, and most severely, the Standard forbids its existence. Allocators are forbidden from returning memory "inside themselves". This requirement is implied by the Standard's requirements for rebinding and equality. It's permitted to return memory from a separate buffer object on the stack, though." This patch attempts to address all of those issues. First, instead of storing the buffer inside the allocator I've change `stack_allocator` to accept the buffer as an argument. Second, in order to fix rebinding I changed the parameter list from `<class T, size_t NumElements>` to `<class T, size_t NumBytes>`. This allows allocator rebinding between types that have different sizes. Third, I added copy and rebinding constructors and assignment operators. And finally I fixed the allocation logic to always return properly aligned storage. Reviewers: mclow.lists, howard.hinnant, STL_MSFT Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25154 llvm-svn: 283631
* Fix shadow warnings. Patch from STL@microsoft.comEric Fiselier2016-10-071-10/+10
| | | | llvm-svn: 283618
* Fix various issues in std::any and the related tests.Eric Fiselier2016-10-0713-153/+191
| | | | | | | | | | | | | | | | | | | | * Fix self-swap. Patch from Casey Carter. * Remove workarounds and tests for types with deleted move constructors. This was originally added as part of a LWG proposed resolution that has since changed. * Re-apply most recent PR for LWG 2769. * Re-apply most recent PR for LWG 2754. Specifically fix the SFINAE checks to use the decayed type. * Fix tests to allow moved-from std::any's to have a non-empty state. This is the behavior of MSVC's std::any. * Various whitespace and test fixes. llvm-svn: 283606
* [libcxx] Recover no-exceptions XFAILs - IAsiri Rathnayake2016-10-0621-28/+95
| | | | | | | | | | | | | | | | First batch of changes to get some of these XFAILs working in the no-exceptions libc++ variant. Changed some XFAILs to UNSUPPORTED where the test is all about exception handling. In other cases, used the test macros TEST_THROW and TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test that concerns exception handling behaviour. Reviewers: EricWF, mclow.lists Differential revision: https://reviews.llvm.org/D24562 llvm-svn: 283441
* Comment out failing test while I figure out who is at faultMarshall Clow2016-10-051-1/+1
| | | | llvm-svn: 283360
* Make tests for is_empty better. No functional change.Marshall Clow2016-10-051-5/+31
| | | | llvm-svn: 283339
* Add another append test for basic_stringMarshall Clow2016-10-051-0/+4
| | | | llvm-svn: 283331
* Add tests to make sure that is_constructible<cv-void> is false. We already ↵Marshall Clow2016-10-031-0/+3
| | | | | | checked 'unqualified void'. This was brought up by LWG#2738 llvm-svn: 283161
* Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilitiesEric Fiselier2016-10-0145-209/+118
| | | | llvm-svn: 283032
* Replace test_throw.h header with a single test macroEric Fiselier2016-10-016-12/+6
| | | | llvm-svn: 283030
* [libc++] Extension: Make `move` and `forward` constexpr in C++11.Eric Fiselier2016-09-2616-477/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `std::move` and `std::forward` were not marked constexpr in C++11. This can be very damaging because it makes otherwise constant expressions non-constant. For example: ``` #include <utility> template <class T> struct Foo { constexpr Foo(T&& tx) : t(std::move(tx)) {} T t; }; [[clang::require_constant_initialization]] Foo<int> f(42); // Foo should be constant initialized but C++11 move is not constexpr. As a result `f` is an unsafe global. ``` This patch applies `constexpr` to `move` and `forward` as an extension in C++11. Normally the library is not allowed to add `constexpr` because it may be observable to the user. In particular adding constexpr may cause valid code to stop compiling. However these problems only happen in more complex situations, like making `__invoke(...)` constexpr. `forward` and `move` are simply enough that applying `constexpr` is safe. Note that libstdc++ has offered this extension since at least 4.8.1. Most of the changes in this patch are simply test cleanups or additions. The main changes in the tests are: * Fold all `forward_N.fail.cpp` tests into a single `forward.fail.cpp` test using -verify. * Delete most `move_only_N.fail.cpp` tests because they weren't actually testing anything. * Fold `move_copy.pass.cpp` and `move_only.pass.cpp` into a single `move.pass.cpp` test. * Add return type and noexcept tests for `forward` and `move`. Reviewers: rsmith, mclow.lists, EricWF Subscribers: K-ballo, loladiro Differential Revision: https://reviews.llvm.org/D24637 llvm-svn: 282439
OpenPOWER on IntegriCloud