summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add include for 'test_macros.h' to all the tests that were missing them. ↵Marshall Clow2019-05-311-0/+2
| | | | | | Thanks to Zoe for the (big, but simple) patch. NFC intended. llvm-svn: 362252
* [libc++] Fix XFAILs when exceptions are disabledLouis Dionne2019-02-051-1/+1
| | | | | | | | It turns out that I un-XFAILed too many tests in r353210: some tests actually fail whether exceptions are enabled or not because they use types that are marked as unavailable even when exceptions are disabled. llvm-svn: 353215
* [libc++] Fix XFAILs on macOS when exceptions are disabledLouis Dionne2019-02-051-1/+1
| | | | | | | | 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-051-8/+1
| | | | | | | | | | | | | | | | | 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-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-4/+3
| | | | | | | | | | | | | | | | | | 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] Remove the availability_markup LIT featureLouis Dionne2018-12-071-7/+7
| | | | | | | It is now equivalent to the 'availability' LIT feature, so there's no reason to keep both. llvm-svn: 348653
* [libcxx] Add availability markup for bad_optional_access, bad_variant_access ↵Louis Dionne2018-11-191-0/+8
| | | | | | | | | | | | and bad_any_cast Reviewers: dexonsmith, EricWF Subscribers: christof, arphaman, libcxx-commits Differential Revision: https://reviews.llvm.org/D53256 llvm-svn: 347219
* 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
* Implement N4606 optionalEric Fiselier2016-10-121-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-121-25/+0
| | | | llvm-svn: 283978
* Add <optional> header.Eric Fiselier2016-10-121-0/+25
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