summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/optional
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-06-142-2/+2
| | | | llvm-svn: 334676
* Mark deduction guide tests as failing on apple-clang-9JF Bastien2018-05-291-1/+1
| | | | | | | As discussed here: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058116.html The tests fail on clang-5, as well as apple-clang-9. Mark them as such. llvm-svn: 333479
* Fix up the final bits of breakage due to clang v5 generating bad implicit ↵Marshall Clow2018-05-282-9/+14
| | | | | | template deduction guides - specifically for copy-ctors llvm-svn: 333381
* Fix optional<char> test breakageJF Bastien2018-05-251-0/+4
| | | | | | It seems GCC and clang disagree. Talked to mclow on IRC, disabling for now. llvm-svn: 333317
* Fix optional deduction guide test breakageJF Bastien2018-05-252-2/+2
| | | | llvm-svn: 333308
* Add one more test for optionalMarshall Clow2018-05-251-5/+14
| | | | llvm-svn: 333252
* Add deduction guides for optionalMarshall Clow2018-05-252-0/+82
| | | | llvm-svn: 333251
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-154-4/+4
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* Placate unused variable warnings uncovered by improvements to clang's ↵Benjamin Kramer2017-10-141-0/+1
| | | | | | -Wunused-variable llvm-svn: 315809
* Fix failing -verify tests due to change in Clangs static_assert message.Eric Fiselier2017-09-171-6/+6
| | | | | | | | 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
* [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] Untabify, NFC.Stephan T. Lavavej2017-07-293-12/+12
| | | | llvm-svn: 309464
* optional: Implement LWG 2900 and P0602Casey Carter2017-07-094-27/+55
| | | | | | Differential Revision: https://reviews.llvm.org/D32385 llvm-svn: 307505
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-06-201-1/+1
| | | | llvm-svn: 305848
* [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
* 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
* 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
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-049-0/+67
| | | | | | | | | | | | | | | Libc++ is used as a system library on macOS and iOS (amongst others). In order for users to be able to compile a binary that is intended to be deployed to an older version of the platform, clang provides the availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_ that can be placed on declarations to describe the lifecycle of a symbol in the library. See docs/DesignDocs/AvailabilityMarkup.rst for more information. Differential Revision: https://reviews.llvm.org/D31739 llvm-svn: 302172
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-05-042-4/+4
| | | | llvm-svn: 302105
* Expand test coverage for LWG2857Casey Carter2017-04-212-6/+16
| | | | | | | | | | * Cover optional's emplace-from-initializer_list overload * Verify that any::emplace and optional::emplace return a reference to the correct type even for throwing cases. Differential Revision: https://reviews.llvm.org/D32106 llvm-svn: 301055
* Allow a standard library to implement conditional noexcept for optional and ↵Billy Robert O'Neal III2017-04-181-4/+8
| | | | | | | | | | unique_ptr hash functions. These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way. Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions. llvm-svn: 300516
* [optional] Update synopsis for LWG2934Casey Carter2017-04-1712-18/+18
| | | | | | (comment-only change) llvm-svn: 300488
* Additional test file for r300123Marshall Clow2017-04-121-17/+47
| | | | llvm-svn: 300124
* Add some FAIL constexpr tests for optional's copy/move ctors.Marshall Clow2017-04-122-0/+73
| | | | llvm-svn: 300009
* Revert "Allow a standard library to implement conditional noexcept for ↵Akira Hatanaka2017-04-071-6/+3
| | | | | | | | optional and unique_ptr hash functions." This reverts commit r299734. llvm-svn: 299744
* Add noexcept(false) to more strongly indicate that not being noexcept is ↵Billy Robert O'Neal III2017-04-061-1/+1
| | | | | | important for hash tests. llvm-svn: 299735
* Allow a standard library to implement conditional noexcept for optional and ↵Billy Robert O'Neal III2017-04-061-3/+6
| | | | | | | | | | unique_ptr hash functions. These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way. Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions. llvm-svn: 299734
* Fix more -Wshadow warnings introduced by recent Clang changeEric Fiselier2017-04-041-1/+0
| | | | llvm-svn: 299411
* Fix LWG 2934 - optional<const T> doesn't compare with TEric Fiselier2017-03-3012-400/+534
| | | | llvm-svn: 299105
* Implement LWG 2842 - optional(U&&) needs to SFINAE on decay_t<in_place_t>Eric Fiselier2017-03-301-0/+14
| | | | llvm-svn: 299100
* Worked around GCC bug 56480. Explicit specialization in a different namespace.Michael Park2017-03-231-1/+5
| | | | | | | | | | | | Summary: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 Reviewers: EricWF Reviewed By: EricWF Differential Revision: https://reviews.llvm.org/D31273 llvm-svn: 298581
* Implement P0599: 'noexcept for hash functions'. Fix a couple of hash ↵Marshall Clow2017-03-231-0/+3
| | | | | | functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234 llvm-svn: 298573
* [libcxx] [test] Strip trailing whitespace.Stephan T. Lavavej2017-02-052-2/+2
| | | | | | No functional change, no code review. llvm-svn: 294161
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.Stephan T. Lavavej2017-02-051-5/+0
| | | | | | | | These typedefs were completely unused. Fixes D29136. llvm-svn: 294155
* Change the base class of std::bad_optional_access. This is a (subtle) ABI ↵Marshall Clow2017-02-051-3/+3
| | | | | | change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error. llvm-svn: 294133
* Mark LWG2736 as complete. No code changes, but we have more tests nowMarshall Clow2017-01-242-3/+35
| | | | llvm-svn: 292958
* Implement P0513R0 - "Poisoning the Hash"Eric Fiselier2017-01-212-0/+47
| | | | | | | | | | | | | | | | | | | | | Summary: Exactly what the title says. This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it. See http://wg21.link/P0513R0 for more info. If there are no comments in the next couple of days I'll commit this Reviewers: mclow.lists, K-ballo, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28938 llvm-svn: 292684
* Fix unused parameters and variablesEric Fiselier2016-12-231-0/+1
| | | | llvm-svn: 290459
* [libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t' ↵Stephan T. Lavavej2016-12-061-2/+2
| | | | | | | | | | | | | to 'int' [or 'unsigned int'], possible loss of data", part 2/4. Use static_cast<int> when storing size_t in int (or passing size_t to int). Also, remove a spurious semicolon in test/support/archetypes.hpp. test/support/count_new.hpp Additionally, change data members (and parameters) to size_t. llvm-svn: 288752
* Add more tests for optional<const T>Eric Fiselier2016-10-286-0/+29
| | | | llvm-svn: 285384
* Fix unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-10-233-3/+3
| | | | llvm-svn: 284942
* Fix shadowing warning. Patch from STL@microsoft.comEric Fiselier2016-10-231-1/+1
| | | | llvm-svn: 284941
* Update status for std::optional LWG issues and fix an optional SFINAE bugEric Fiselier2016-10-161-0/+12
| | | | llvm-svn: 284323
* Implement N4606 optionalEric Fiselier2016-10-1272-0/+6356
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1272-6346/+0
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-1272-0/+6346
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
OpenPOWER on IntegriCloud