summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-161-0/+12
| | | | 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
* Add void_t and invoke feature test macrosEric Fiselier2016-10-142-0/+75
| | | | llvm-svn: 284209
* 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
* 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-121-4/+6
| | | | llvm-svn: 284002
* 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
* 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
* 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
* Add missing <memory> include in testEric Fiselier2016-10-081-0/+1
| | | | llvm-svn: 283633
* 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
* 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 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
* [libc++] Remove various C++03 feature test macrosEric Fiselier2016-09-257-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Libc++ still uses per-feature configuration macros when configuring for C++11. However libc++ requires a feature-complete C++11 compiler so there is no reason to check individual features. This patch starts the process of removing the feature specific macros and replacing their usage with `_LIBCPP_CXX03_LANG`. This patch removes the __config macros: * _LIBCPP_HAS_NO_TRAILING_RETURN * _LIBCPP_HAS_NO_TEMPLATE_ALIASES * _LIBCPP_HAS_NO_ADVANCED_SFINAE * _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS * _LIBCPP_HAS_NO_STATIC_ASSERT As a drive I also changed our C++03 static_assert to use _Static_assert if available. I plan to commit this without review if nobody voices an objection. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24895 llvm-svn: 282347
* Fix failure on 03 botMarshall Clow2016-09-221-2/+2
| | | | llvm-svn: 282134
* Add missing _v traits. is_bind_expression_v, is_placeholder_v and ↵Marshall Clow2016-09-223-8/+38
| | | | | | uses_allocator_v llvm-svn: 282126
* Improve constexpr tests for std::anyEric Fiselier2016-09-071-9/+9
| | | | llvm-svn: 280777
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+140
| | | | | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. This patch was originally committed as r279953 but was reverted due to warnings in the test-suite. This new patch corrects those warnings. llvm-svn: 279955
* Revert r279953 - Fix pair::operator=(TupleLike&&)Eric Fiselier2016-08-291-135/+0
| | | | | | | The test emits warnings causing the test-suite to fail. Since I want this patch merged into 3.9 I'll recommit it with a clean test. llvm-svn: 279954
* Fix pair::operator=(TupleLike&&).Eric Fiselier2016-08-291-0/+135
| | | | | | | | This assignment operator was previously broken since the SFINAE always resulted in substitution failure. This caused assignments to turn into copy construction + assignment. llvm-svn: 279953
* Unbreak C++03 build.Eric Fiselier2016-08-111-1/+1
| | | | llvm-svn: 278323
* Refactor test archetypes implementation.Eric Fiselier2016-08-116-68/+74
| | | | llvm-svn: 278319
* [libcxx] Add std::anyEric Fiselier2016-08-1121-0/+2488
| | | | | | | | | | | | | | | | | | | Summary: This patch adds std::any by moving/adapting <experimental/any>. This patch also implements the std::any parts of p0032r3 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf) and LWG 2509 (http://cplusplus.github.io/LWG/lwg-defects.html#2509). I plan to push it in a day or two if there are no comments. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22733 llvm-svn: 278310
* Implement LWG 2148: Make non-enum default hash specialization well-formedEric Fiselier2016-08-102-5/+40
| | | | | | | | | | | | | | | | | Summary: This patch removes the static_assert for non-enum types in the primary hash template. Instead non-enum types create a hash<T> specialization that is not constructible nor callable. See also: * http://cplusplus.github.io/LWG/lwg-active.html#2543 * https://llvm.org/bugs/show_bug.cgi?id=28917 Reviewers: mclow.lists, EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D23331 llvm-svn: 278300
* Fix an MSVC x64 compiler warning. Patch from STL@microsoft.comEric Fiselier2016-08-033-9/+12
| | | | llvm-svn: 277573
* Remove use of C++1z static assert in C++11 testEric Fiselier2016-07-251-8/+8
| | | | llvm-svn: 276608
* Implement the std::pair parts of "Improving pair and tuple". Completes N4387.Eric Fiselier2016-07-259-35/+668
| | | | llvm-svn: 276605
* Recommit r276548 - Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-255-2/+334
| | | | | | | I think I've solved issues with is_assignable and references to incomplete types. The updated patch adds tests for this case. llvm-svn: 276603
* Make std::is_assignable tolerate references to incomplete types.Eric Fiselier2016-07-251-2/+5
| | | | llvm-svn: 276599
* Revert r276548 - Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-255-310/+2
| | | | | | | | | | | | This is a breaking change. The SFINAE required is instantiated the second the class is instantiated, and this can cause hard SFINAE errors when applied to references to incomplete types. Ex. struct IncompleteType; extern IncompleteType it; std::tuple<IncompleteType&> t(it); // SFINAE will blow up. llvm-svn: 276598
* Don't SFINAE pair's copy assignment operator in C++03 mode.Eric Fiselier2016-07-251-0/+36
| | | | | | | | In C++03 mode evaluating the SFINAE can cause a hard error due to access control violations. This is a problem because the SFINAE is evaluated as soon as the class is instantiated, and not later. llvm-svn: 276594
* Work around MSVC's non-standard ABI for enums. Patch from STL@microsoft.comEric Fiselier2016-07-253-5/+22
| | | | llvm-svn: 276589
* Fix unique_ptr.runtime tests for null inputs. Patch from STL@microsoft.comEric Fiselier2016-07-242-0/+13
| | | | llvm-svn: 276587
* Fix MSVC unreferenced parameter warning. Patch from STL@microsoft.comEric Fiselier2016-07-241-1/+1
| | | | llvm-svn: 276583
* Guard libc++ specific tests SFINAE on std::bind's call operator. Patch from ↵Eric Fiselier2016-07-241-3/+5
| | | | | | STL@microsoft.com llvm-svn: 276576
* Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-244-2/+274
| | | | llvm-svn: 276548
* Fix memory leak in test.Eric Fiselier2016-07-241-0/+4
| | | | llvm-svn: 276547
* Implement LWG 2393. Check for LValue-callability.Eric Fiselier2016-07-243-0/+65
| | | | llvm-svn: 276546
OpenPOWER on IntegriCloud