summaryrefslogtreecommitdiffstats
path: root/libcxx/include/exception
Commit message (Collapse)AuthorAgeFilesLines
* Make move and forward work in C++03.Eric Fiselier2019-06-211-8/+0
| | | | | | | | | | | | | | | | | | | | | These functions are key to allowing the use of rvalues and variadics in C++03 mode. Everything works the same as in C++11, except for one tangentially related case: struct T { T(T &&) = default; }; In C++11, T has a deleted copy constructor. But in C++03 Clang gives it both a move and a copy constructor. This seems reasonable enough given the extensions it's using. The other changes in this patch were the minimal set required to keep the tests passing after the move/forward change. Most notably the removal of the `__rv<unique_ptr>` hack that was present in an attempt to make unique_ptr move only without language support. llvm-svn: 364063
* Make VCRuntime ABI configuration a first-class option.Eric Fiselier2019-03-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: On Windows we currently provide two separate ABI configurations. One which defers to `vcruntime` to provide the C++ runtime and another which doesn't. Using `vcruntime` allows interoperability which programs compiled against the MSVC STL, and should be preferred whenever possible. When deferring to `vcruntime` much of the ABI we provide changes. Including the layout of `<stdexcept>` types, their vtables, and how the linkage of their members. This patch introduces the `_LIBCPP_ABI_VCRUNTIME` macro to denote this configuration. It also cleans up the existing configuration for using `vcruntime`. This cleanup lays the groundwork for fixing a number of ABI and interoperability bugs in `<stdexcept>`. Reviewers: thomasanderson, ldionne, smeenai Reviewed By: smeenai Subscribers: jdoerfert, libcxx-commits, #libc Differential Revision: https://reviews.llvm.org/D58942 llvm-svn: 355366
* 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] Mark stray symbols as hidden to try and fix the buildLouis Dionne2018-11-211-2/+2
| | | | | | | | | | | | r347395 changed the ABI list on Linux, but two of those symbols are still being exported from the shared object: _ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_ _ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_ This commit makes sure those symbols are not exported, as they should be. llvm-svn: 347399
* Implement the infrastructure for feature-test macros. Very few actual ↵Marshall Clow2018-09-121-0/+1
| | | | | | feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955 llvm-svn: 342073
* [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Note that this commit had originally been applied in r336369 and then reverted in r336382 because of unforeseen problems. Both of these problems have now been fixed. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, erikvanderpoel Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336866
* Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-051-2/+2
| | | | | | | | | | | | | | | _LIBCPP_INLINE_VISIBILITY" This reverts commit r336369. The commit had two problems: 1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the dylib and the check-cxx-abilist failing. 2. The LLDB tests started failing because they undefine `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and fix the tests before we can go forward with this change. llvm-svn: 336382
* [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: We never actually mean to always inline a function -- all the uses of the macro I could find are actually attempts to control the visibility of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which is actually always defined the same. This change is orthogonal to the decision of what we're actually going to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by having one canonical way of doing things. Reviewers: EricWF Subscribers: christof, llvm-commits, dexonsmith, erikvanderpoel, mclow.lists Differential Revision: https://reviews.llvm.org/D48892 llvm-svn: 336369
* [libc++] Support Microsoft ABI without vcruntime headersShoaib Meenai2017-10-091-3/+3
| | | | | | | | | | | | | | | | | The vcruntime headers are hairy and clash with both libc++ headers themselves and other libraries. libc++ normally deals with the clashes by deferring to the vcruntime headers and silencing its own definitions, but for clients which don't want to depend on vcruntime headers, it's desirable to support the opposite, i.e. have libc++ provide its own definitions. Certain operator new/delete replacement scenarios are not currently supported in this mode, which requires some tests to be marked XFAIL. The added documentation has more details. Differential Revision: https://reviews.llvm.org/D38522 llvm-svn: 315234
* [libc++] Implement exception_ptr on WindowsEric Fiselier2017-05-081-3/+54
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC. The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well. Note there are still 2 outstanding exception_ptr/nested_exception test failures. * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time. * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion. This patch also gets most of the `<future>` tests passing as well. Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D32927 llvm-svn: 302393
* Add markup for libc++ dylib availabilityMehdi Amini2017-05-041-1/+1
| | | | | | | | | | | | | | | 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
* Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>Eric Fiselier2017-04-191-8/+8
| | | | llvm-svn: 300649
* Implement LWG#2855 - made easy by previous refactoringMarshall Clow2017-04-131-2/+2
| | | | llvm-svn: 300218
* Refactor throw_with_nested. NFC.Marshall Clow2017-04-131-31/+39
| | | | llvm-svn: 300197
* Implement LWG2784, and mark 2786, 2795, 2804, 2812, 2826, 2834, 2837 and ↵Marshall Clow2017-03-141-6/+10
| | | | | | 2838 as complete - since we do them already llvm-svn: 297752
* [libcxx] Remove unexpected handlers in C++17Eric Fiselier2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | | Summary: This patch implements [P0003R5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) which removes exception specifications from C++17. The only changes to the library are removing `set_unexpected`, `get_unexpected`, `unexpected`, and `unexpected_handler`. These functions can be re-enabled in C++17 using `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`. @mclow.lists what do you think about removing stuff is this way? Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: mclow.lists, cfe-commits Differential Revision: https://reviews.llvm.org/D28172 llvm-svn: 295406
* Recommit "Split exception.cpp and new.cpp implementation into different ↵Eric Fiselier2017-02-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | files for different runtimes." This recommits r294707 with additional fixes. The main difference is libc++ now correctly builds without any ABI library. exception.cpp is a bloody mess. It's full of confusing #ifdef branches for each different ABI library we support, and it's getting unmaintainable. This patch breaks down exception.cpp into multiple different header files, roughly one per implementation. Additionally it moves the definitions of exceptions in new.cpp into the correct implementation header. This patch also removes an unmaintained libc++abi configuration. This configuration may still be used by Apple internally but there are no other possible users. If it turns out that Apple still uses this configuration internally I will re-add it in a later commit. See http://llvm.org/PR31904. llvm-svn: 294730
* Revert "Split exception.cpp and new.cpp implementation into different files ↵Eric Fiselier2017-02-101-6/+0
| | | | | | | | for different runtimes." The compiler-rt CMake configuration needs some tweaking before this can land. llvm-svn: 294727
* Split exception.cpp and new.cpp implementation into different files for ↵Eric Fiselier2017-02-101-0/+6
| | | | | | | | | | | | | | | | | | | different runtimes. exception.cpp is a bloody mess. It's full of confusing #ifdef branches for each different ABI library we support, and it's getting unmaintainable. This patch breaks down exception.cpp into multiple different header files, roughly one per implementation. Additionally it moves the definitions of exceptions in new.cpp into the correct implementation header. This patch also removes an unmaintained libc++abi configuration. This configuration may still be used by Apple internally but there are no other possible users. If it turns out that Apple still uses this configuration internally I will re-add it in a later commit. See http://llvm.org/PR31904. llvm-svn: 294707
* Fix unused parameters and variablesEric Fiselier2016-12-231-0/+7
| | | | llvm-svn: 290459
* Make make_exception_ptr abort with -fno-exceptionsEric Fiselier2016-12-031-1/+4
| | | | llvm-svn: 288575
* Try 2 - Remove <cstdlib> include from `<exception>`Eric Fiselier2016-09-061-4/+0
| | | | | | | | | | | This patch removes the `<cstdlib>` include from exception where it is no longer needed. Unlike my previous attempt this patch also adds <cstdlib> where needed in other headers like <new> and <typeinfo>. This won't fix the Firefox build issues discussed on IRC but it is more correct for libc++. llvm-svn: 280754
* Revert r280743 and r280745. Remove <cstdlib> include from `<exception>`Eric Fiselier2016-09-061-0/+4
| | | | | | | Apparently I missed a number of additional include which need to be added. Reverting so I can recommit as a single patch with all of the required includes. llvm-svn: 280752
* Remove unneeded includes in <exception> after removing __libcpp_throwEric Fiselier2016-09-061-4/+0
| | | | llvm-svn: 280743
* Followon to r279744. Find the other exception types and make __throw_XXX ↵Marshall Clow2016-08-251-15/+0
| | | | | | routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. llvm-svn: 279763
* Fix typo it _LIBCPP_NO_EXCEPTIONS macroEric Fiselier2016-05-071-2/+2
| | | | llvm-svn: 268838
* Add <experimental/memory_resource>Eric Fiselier2016-05-071-0/+19
| | | | | | | | | | Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20007 llvm-svn: 268829
* Fix a corner case that involved calling rethrow_if_nested with a type that ↵Marshall Clow2015-12-141-1/+1
| | | | | | had a deleted operator&. Added a test to catch this as well. Thanks to Ville for the heads-up. llvm-svn: 255517
* [libcxx] Fix detection of __is_final.Eric Fiselier2015-06-131-6/+2
| | | | | | | | | | | | | | Summary: Currently we only enable the use of __is_final(...) with Clang. GCC also provides __is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of `__is_final`. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8795 llvm-svn: 239664
* Implement uncaught_exceptions() using the newly added hooks in libc++abi, ↵Marshall Clow2015-06-021-1/+3
| | | | | | when available llvm-svn: 238846
* Fix building and testing libc++ with GCC.Eric Fiselier2015-05-201-2/+2
| | | | | | | | | | | | | | | | The changes in src/exception.cpp and cmake/Modules/HandleLibCXXABI.cmake fix a bug when building libc++ with GCC. Because GCC does not support __has_include we need to explicitly tell it that we are building against libc++abi via the preprocessor definition `LIBCXX_BUILDING_LIBCXXABI`. The changes in include/ratio are to work around CWG defect 1712 (constexpr variable template declarations). GCC 4.8 and before has not adopted the resolution to this defect. The changes in include/exception work around an issue where is_final is used without it being defined in type_traits. llvm-svn: 237767
* Fix a problem when calling throw_with_nested with a class marked 'final'. ↵Marshall Clow2015-03-161-0/+6
| | | | | | Thanks to STL @ Microsoft for the bug report. llvm-svn: 232384
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-4/+4
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-061-9/+9
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Remove 'noreturn' attribute from friend declaration. This attribute will beRichard Smith2012-11-291-1/+1
| | | | | | | inherited from the previous out-of-class declaration, and attributes on friend function declarations are ill-formed in C++11. llvm-svn: 168853
* Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you ↵Howard Hinnant2012-09-141-1/+1
| | | | | | send me a patch to CREDITS.TXT? llvm-svn: 163862
* libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with aRichard Smith2012-07-261-7/+7
| | | | | | platform-provided macro on some systems) to _LIBCPP_NORETURN. llvm-svn: 160773
* Modernize conversion to bool to the explicit bool conversion operator ↵Howard Hinnant2012-02-211-1/+1
| | | | | | (library wide). This fixes http://llvm.org/bugs/show_bug.cgi?id=12058. llvm-svn: 151088
* Quash a whole bunch of warningsHoward Hinnant2011-12-011-1/+1
| | | | llvm-svn: 145624
* Further macro protection by replacing _[A-Z] with _[A-Z]pHoward Hinnant2011-11-291-8/+8
| | | | llvm-svn: 145410
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-2/+2
| | | | llvm-svn: 134190
* Applied noexcept to everything in [language.support] (Chapter 18)Howard Hinnant2011-05-261-52/+52
| | | | llvm-svn: 132129
* Added [[noreturn]] attribute everywhere it should beHoward Hinnant2011-05-261-7/+9
| | | | llvm-svn: 132125
* N3189 Observers for the three handler functionsHoward Hinnant2010-12-021-0/+4
| | | | llvm-svn: 120712
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* visibility-decoration.Howard Hinnant2010-09-211-9/+12
| | | | llvm-svn: 114486
* Changed __config to react to all of clang's currently documented has_feature ↵Howard Hinnant2010-09-041-6/+6
| | | | | | flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. llvm-svn: 113086
* Fixing whitespace problemsHoward Hinnant2010-08-221-7/+7
| | | | llvm-svn: 111750
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+6
| | | | llvm-svn: 110828
OpenPOWER on IntegriCloud