summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/optional/optional.object
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Cleanup and enable multiple warnings.Eric Fiselier2019-12-121-0/+1
| | | | | | | | | | Too many warnings are being disabled too quickly. Warnings are important to keeping libc++ correct. This patch re-enables two warnings: -Wconstant-evaluated and -Wdeprecated-copy. In future, all warnings disabled for the test suite should require an attached bug. The bug should state the plan for re-enabling that warning, or a strong case why it should remain disabled.
* [libcxx][NFC] Strip trailing whitespace, fix typo.Stephan T. Lavavej2019-10-231-2/+2
|
* [NFC] Strip trailing whitespace from libc++Louis Dionne2019-10-231-1/+1
|
* libcxx: Rename .hpp files in libcxx/test/support to .hNico Weber2019-08-2118-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | LLVM uses .h as its extension for header files. Files renamed using: for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done References to the files updated using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do a=$(basename $f); echo $a; rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/"; done HPP include guards updated manually using: for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do echo ${f%.hpp}.h ; done | xargs mvim Differential Revision: https://reviews.llvm.org/D66104 llvm-svn: 369481
* Add a missing '__uncvref_t' to the SFINAE constraints for optional's ↵Marshall Clow2019-06-271-0/+12
| | | | | | assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report llvm-svn: 364574
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-318-0/+16
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* Update test to better check for the non-constexpr-ness of a move ↵Marshall Clow2019-04-251-5/+20
| | | | | | constructor. Fixes PR#41577. llvm-svn: 359162
* Cleaup of requirements for optional. While researching LWG3196, I realized ↵Marshall Clow2019-03-251-0/+47
| | | | | | that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code. llvm-svn: 356918
* Allow optional to tolerate being used with a nested class.Eric Fiselier2019-03-111-0/+41
| | | | | | | | | | | | | | | When Clang tries to complete a type containing `std::optional` it considers the `in_place_t` constructor with no arguments which checks if the value type is default constructible. If the value type is a nested class type, then this check occurs too early and poisons the is_default_constructible trait. This patch makes optional deduce `in_place_t` so we can prevent this early SFINAE evaluation. Technically this could break people doing weird things with the in_place_t tag, but that seems less important than making the nested class case work. llvm-svn: 355877
* [libc++] Fix XFAILs on macOS when exceptions are disabledLouis Dionne2019-02-058-8/+8
| | | | | | | | Some tests are marked as failing on platforms where the dylib does not provide the required exception classes. However, when testing with exceptions disabled, those tests shouldn't be marked as failing. llvm-svn: 353210
* [libcxx] Start defining lit features for tests depending on availabilityLouis Dionne2019-02-058-56/+8
| | | | | | | | | | | | | | | | | This patch removes some vendor-specific availability XFAILs from the test suite. In the future, when a new feature is introduced in the dylib, an availability macro should be created and a matching lit feature should be created. That way, the test suite can XFAIL whenever the implementation lacks the necessary feature instead of being cluttered by vendor-specific annotations. Right now, those vendor-specific annotations are still somewhat cluttering the test suite by being in `config.py`, but at least they are localized. In the future, we could design a way to define those less intrusively or even automatically based on the availability macros that already exist in <__config>. llvm-svn: 353201
* Support tests in freestandingJF Bastien2019-02-0446-46/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Freestanding is *weird*. The standard allows it to differ in a bunch of odd manners from regular C++, and the committee would like to improve that situation. I'd like to make libc++ behave better with what freestanding should be, so that it can be a tool we use in improving the standard. To do that we need to try stuff out, both with "freestanding the language mode" and "freestanding the library subset". Let's start with the super basic: run the libc++ tests in freestanding, using clang as the compiler, and see what works. The easiest hack to do this: In utils/libcxx/test/config.py add: self.cxx.compile_flags += ['-ffreestanding'] Run the tests and they all fail. Why? Because in freestanding `main` isn't special. This "not special" property has two effects: main doesn't get mangled, and main isn't allowed to omit its `return` statement. The first means main gets mangled and the linker can't create a valid executable for us to test. The second means we spew out warnings (ew) and the compiler doesn't insert the `return` we omitted, and main just falls of the end and does whatever undefined behavior (if you're luck, ud2 leading to non-zero return code). Let's start my work with the basics. This patch changes all libc++ tests to declare `main` as `int main(int, char**` so it mangles consistently (enabling us to declare another `extern "C"` main for freestanding which calls the mangled one), and adds `return 0;` to all places where it was missing. This touches 6124 files, and I apologize. The former was done with The Magic Of Sed. The later was done with a (not quite correct but decent) clang tool: https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed This works for most tests, though I did have to adjust a few places when e.g. the test runs with `-x c`, macros are used for main (such as for the filesystem tests), etc. Once this is in we can create a freestanding bot which will prevent further regressions. After that, we can start the real work of supporting C++ freestanding fairly well in libc++. <rdar://problem/47754795> Reviewers: ldionne, mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits Differential Revision: https://reviews.llvm.org/D57624 llvm-svn: 353086
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1946-184/+138
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [libcxx] Reorganize tests since the application of P0602R4Louis Dionne2019-01-106-141/+201
| | | | | | | | | | | | | | | | | Summary: P0602R4 makes the special member functions of optional and variant conditionally trivial based on the types in the optional/variant. We already implemented that, but the tests were organized as if this were a non-standard extension. This patch reorganizes the tests in a way that makes more sense since this is not an extension anymore. Reviewers: EricWF, mpark, mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54772 llvm-svn: 350884
* [libcxx] Add availability markup for bad_optional_access, bad_variant_access ↵Louis Dionne2018-11-198-48/+56
| | | | | | | | | | | | and bad_any_cast Reviewers: dexonsmith, EricWF Subscribers: christof, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D53256 llvm-svn: 347219
* [NFC] Reformat std::optional testsLouis Dionne2018-11-122-4/+4
| | | | llvm-svn: 346630
* [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
* 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
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-292-11/+11
| | | | 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-048-0/+60
| | | | | | | | | | | | | | | 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
* 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
* Fix more -Wshadow warnings introduced by recent Clang changeEric Fiselier2017-04-041-1/+0
| | | | llvm-svn: 299411
* Implement LWG 2842 - optional(U&&) needs to SFINAE on decay_t<in_place_t>Eric Fiselier2017-03-301-0/+14
| | | | llvm-svn: 299100
* [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
* Fix unused parameters and variablesEric Fiselier2016-12-231-0/+1
| | | | llvm-svn: 290459
* 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-232-2/+2
| | | | 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-1242-0/+4630
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1242-4669/+0
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-1242-0/+4669
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