summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* [libc++] Refactoring __sync_* builtins; NFCWeiming Zhao2017-07-102-4/+36
| | | | | | | | | | | | Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets. Reviewers: danalbert, EricWF, jroelofs Subscribers: joerg, llvm-commits Differential Revision: https://reviews.llvm.org/D34918 llvm-svn: 307591
* optional: Implement LWG 2900 and P0602Casey Carter2017-07-091-14/+90
| | | | | | Differential Revision: https://reviews.llvm.org/D32385 llvm-svn: 307505
* cmath: Support clang's -fdelayed-template-parsingDuncan P. N. Exon Smith2017-07-072-85/+85
| | | | | | | | | | | r283051 added some functions to cmath (in namespace std) that have the same name as functions in math.h (in the global namespace). Clang's limited support for `-fdelayed-template-parsing` chokes on this. Rename the ones in `cmath` and their uses in `complex` and the test. rdar://problem/32848355 llvm-svn: 307357
* Fix a bug in regex_Iterator where it would report zero-length matches ↵Marshall Clow2017-07-051-1/+1
| | | | | | forever. Reported as http://llvm.org/PR33681. Thanks to Karen Arutyunov for the report. llvm-svn: 307171
* Revert "[libcxx] Annotate c++17 aligned new/delete operators with availability"Akira Hatanaka2017-06-302-16/+10
| | | | | | | | | | | | | This reverts commit r306310. r306310 causes clang to reject a call to an aligned allocation or deallocation function if it is not implemented in the standard library of the deployment target. This is not the desired behavior when users have defined their own aligned functions. rdar://problem/32664169 llvm-svn: 306859
* [libc++] Hoist explicit instantiation above implicit. NFCShoaib Meenai2017-06-291-4/+4
| | | | | | | | | | | | | | | | The string literal operators have implicit instantiations of basic_string<char> and basic_string<wchar>, which prevent the dllimport on the subsequent explicit instantiation declarations from having an effect. Hoisting the explicit instantiations above the implicit ones fixes the issue. I think it's pretty unfortunate that the ordering has such an effect, and I'd fixed the same issue for dllexport in r288682. dllimport is more complicated from a codegen perspective, however, and clang's behavior of ignoring the dllimport when there's a previous implicit instantiation is consistent with cl, so changing the order is our only recourse. llvm-svn: 306632
* [libcxx] Annotate c++17 aligned new/delete operators with availabilityAkira Hatanaka2017-06-262-10/+16
| | | | | | | | | | | | | | | | | | | | | | | attribute. This is needed because older versions of libc++ do not have these operators. If users target an older deployment target and try to compile programs in which these operators are explicitly called, the compiler will complain. The following is the list of minimum deployment targets for the four OSes: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34556 llvm-svn: 306310
* Implement inclusive_scan/transform_inclusive_scan for C++17.Marshall Clow2017-06-231-0/+87
| | | | llvm-svn: 306083
* Add a missing SFINAE condition to the `variant`'s converting constructor.Michael Park2017-06-191-0/+2
| | | | | | | | | | | | | | | | | | | | | Remarks: This function shall not participate in overload resolution unless `is_same_v<decay_t<T>, variant>` is false, unless `decay_t<T>` is neither a specialization of `in_place_type_t` nor a specialization of `in_place_index_t`, unless `is_constructible_v<Tj, T>` is true, and unless the expression `FUN(std::forward<T>(t))` (with `FUN` being the above-mentioned set of imaginary functions) is well formed. Depends on D34111. Reviewers: EricWF, K-ballo Reviewed By: EricWF Subscribers: fhahn Differential Revision: https://reviews.llvm.org/D34112 llvm-svn: 305668
* iostreams: Fix deployment target for streams dylib supportDuncan P. N. Exon Smith2017-06-181-2/+2
| | | | | | | | | | | | | | Fix an off-by-one in r302172, which triggered building local versions of the iostreams when deploying to `<= macOS 10.9`, when it should have been `< macOS 10.9`. 10.9 had the dylib support. This defines `_LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE` less often, reducing code size for users with deployment targets of exactly macOS 10.9 or iOS 7.0. rdar://problem/32233981 llvm-svn: 305649
* any: Add availability for experimental::bad_any_castDuncan P. N. Exon Smith2017-06-182-4/+10
| | | | | | | | As a follow up to r302172, add missing availability for bad_any_cast. rdar://problem/32161524 llvm-svn: 305647
* Allow the libc++ C header wrappers to be included when compiling C.Eric Fiselier2017-06-161-2/+3
| | | | | | | | | | C99 at least. C89 still fails due to the use of block comments. NOTE: Having libc++ on the include path when compiling C is not recommended or ever really supported. However it happens often enough that this change is warrented. llvm-svn: 305539
* Allow coroutine_handle<const T> to support creation from const references to ↵Eric Fiselier2017-06-161-2/+4
| | | | | | | | | | | | | | | the promise_type It seems conceivable that a user would need to get a coroutine handle having only a const reference to the promise_type, for example from within a const member function of the promise. This patch allows that use case. A coroutine_handle<const T> can be used in essentially the same way a coroutine_handle<T>, ie to start and destroy the coroutine. The constness of the promise doesn't/shouldn't propagate to the handle. llvm-svn: 305536
* Add missing include to __bsd_locale_fallbacks.h. Fixes ↵Marshall Clow2017-06-151-0/+1
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=33370 llvm-svn: 305469
* attempt to fix GCC ToT build failuresEric Fiselier2017-06-151-1/+1
| | | | llvm-svn: 305451
* [locale] Avoid copy of __atoms when char_type is charAditya Kumar2017-06-142-6/+69
| | | | | | | | | | | | | | | The function num_get<_CharT>::stage2_int_prep makes unnecessary copy of src into atoms when char_type is char. This can be avoided by creating a switch on type and just returning __src when char_type is char. Added the test case to demonstrate performance improvement. In order to avoid ABI incompatibilities, the changes are guarded with a macro _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET Differential Revision: https://reviews.llvm.org/D30268 Reviewed by: EricWF llvm-svn: 305427
* Rework some metaprogramming to use the detection idiom; no functional changeMarshall Clow2017-06-141-99/+58
| | | | llvm-svn: 305417
* Add some const_casts in places where we were implicitly casting away ↵Marshall Clow2017-06-144-12/+14
| | | | | | constness. No functional change, but now they're explicit llvm-svn: 305410
* In several places in std::allocator<const T> (and one in shared_ptr, we were ↵Marshall Clow2017-06-141-9/+11
| | | | | | casting a 'const T*' to a 'void *' - implicitly casting away the const. Add const_cast to make that explicit. No functional change. llvm-svn: 305397
* PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+James Y Knight2017-06-141-0/+3
| | | | | | | | | | | | | | | | | | | | Newlib 2.5 added the locale management functions, so it should not include __nop_local_mgmt.h. This change adds proper guard around that include statement. For newlib 2.4, some releases contain these functions and some don't, and they all have the same version numbers. This patch will work properly with the initial "2.4.0" release which does not include these functions and require __nop_local_mgmt.h. This has been tested against newlib 2.2 and 2.5, and also sanity checks against other different version numbers. Patch by Martin J. O'Riordan and Walter Lee Differential Revision: https://reviews.llvm.org/D32146 llvm-svn: 305394
* Add an `__is_inplace_index` metafunction.Michael Park2017-06-141-0/+6
| | | | | | | | | | | | Summary: This is used to constrain `variant`'s converting constructor correctly. Reviewers: EricWF, mclow.lists Reviewed By: EricWF, mclow.lists Differential Revision: https://reviews.llvm.org/D34111 llvm-svn: 305370
* Implement the non-parallel versions of reduce and transform_reduce for C++17Marshall Clow2017-06-141-0/+93
| | | | llvm-svn: 305365
* Fix bug 33389 - __is_transparent check requires too muchMarshall Clow2017-06-131-10/+7
| | | | llvm-svn: 305292
* Make tuple_element static_assert in pair if the index is out of range. Also, ↵Marshall Clow2017-06-122-1/+7
| | | | | | add a message to variant_alternative<> in the similar case (it already asserted). Add tests for this llvm-svn: 305196
* [array.tuple]/1 says that instantiating tuple_element<N, array<T, M>> is ↵Marshall Clow2017-06-121-0/+1
| | | | | | ill-formed if N >= M. We didn't do that. Add a static_assert to cause a failure, and a test that checks that we failed llvm-svn: 305191
* Implement the non-parallel versions of exclusive_scan and ↵Marshall Clow2017-06-101-0/+71
| | | | | | transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038. llvm-svn: 305136
* Add tests for class template deduction on std::tuple.Eric Fiselier2017-06-081-0/+10
| | | | llvm-svn: 304967
* Revert r304955 - Fix class template deduction for scoped_lock.Eric Fiselier2017-06-081-5/+0
| | | | | | | | Richard decided to fix these cases in Clang, even though they are representative of a larger problem for more complex cases. llvm-svn: 304966
* Fix class template deduction for scoped_lock.Eric Fiselier2017-06-081-1/+5
| | | | | | | | | r304862 changed how CTD handles deducing a non-primary class template using a non-dependent constructor of the primary template. This change requires libc++ to provide explicit deduction guides to make scoped_lock work again. llvm-svn: 304955
* Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZEREric Fiselier2017-06-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | On Bionic PTHREAD_MUTEX_INITIALIZER contains the expression "<enum-type> & <integer-type>", which causes ADL to perform name lookup for operator&. During this lookup Clang decides that it requires the default member initializer for std::mutex while defining the DMI for std::mutex::__m_. If I'm not mistaken this is caused by the explicit noexcept declaration on the defaulted constructor. This patch removes the explicit noexcept and instead allows the compiler to declare the default constructor implicitly noexcept. It also adds a static_assert to ensure that happens. Unfortunatly because it's not easy to change the value of _LIBCPP_MUTEX_INITIALIZER for a single test there is no good way to test this patch. The Clang behavior causing the trouble here was introduced in r287713, which first appears in the 4.0 release. llvm-svn: 304942
* Implement LWG 2904.Michael Park2017-06-071-13/+8
| | | | | | | | | | | | | | | | | | | Summary: - Removed the move-constructibe requirement from copy-assignable. - Updated `__assign_alt` such that we direct initialize if `_Tp` can be `nothrow`-constructible from `_Arg`, or `_Tp`'s move construction can throw. Otherwise, construct a temporary and move it. - Updated the tests to remove the pre-LWG2904 path. Depends on D32671. Reviewers: EricWF, CaseyCarter Reviewed By: EricWF Differential Revision: https://reviews.llvm.org/D33965 llvm-svn: 304891
* add missing constexpr to optional::value_orCasey Carter2017-06-061-1/+1
| | | | | | | | [Credit to cpplearner] Differential Revision: https://reviews.llvm.org/D27850 llvm-svn: 304813
* Fix some undefined behavior in __hash_table. Thanks to vsk for the report ↵Marshall Clow2017-06-031-1/+1
| | | | | | and the patch. Reviewed as https://reviews.llvm.org/D33588. llvm-svn: 304617
* Fix more unreserved namesEric Fiselier2017-06-015-24/+24
| | | | llvm-svn: 304383
* Rename unreserved names in tupleEric Fiselier2017-06-011-40/+40
| | | | llvm-svn: 304382
* Fix Libc++ build with MinGW64Eric Fiselier2017-05-316-21/+16
| | | | | | | | | | | | | | Summary: This patch corrects the build errors I encountered when building on MinGW64. Reviewers: mati865, rnk, compnerd, smeenai, bcraig Reviewed By: mati865, smeenai Subscribers: martell, chapuni, cfe-commits Differential Revision: https://reviews.llvm.org/D33082 llvm-svn: 304360
* [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on WindowsEric Fiselier2017-05-3144-95/+298
| | | | | | | | | | | | | | | | Summary: This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning. This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header. Reviewers: mclow.lists, bcraig, compnerd, EricWF Reviewed By: EricWF Subscribers: cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33080 llvm-svn: 304357
* Remove uses of _UI because Windows is evil and tchar.h #define's itEric Fiselier2017-05-312-111/+111
| | | | llvm-svn: 304348
* Add missing 'requires coroutines' to module mapEric Fiselier2017-05-291-0/+1
| | | | llvm-svn: 304180
* Fix <experimental/coroutine> in C++03Eric Fiselier2017-05-291-2/+2
| | | | llvm-svn: 304173
* [coroutines] Make coroutine_handle<T>::from_address ill-formed for ↵Eric Fiselier2017-05-291-2/+26
| | | | | | | | | | | | | everything but void*. from_address requires that the provided pointer refer to the suspended coroutine, which doesn't have a type, or at least not one knowable by the user. Therefore every use of `from_address` with a typed pointer is almost certainly a bug. This behavior is a part of the TS specification, but hopefully it will be in the future. llvm-svn: 304172
* Fix coroutine test failures caused by API misusages.Eric Fiselier2017-05-291-0/+9
| | | | | | | | More tests to come. I think that from_address overload should be deleted or ill-formed, except for the 'void*' one; The user cannot possibly have a typed pointer to the coroutine state. llvm-svn: 304131
* Fix multiple bugs in coroutine tests.Eric Fiselier2017-05-291-0/+3
| | | | llvm-svn: 304124
* Get <experimental/coroutine> working in C++03.Eric Fiselier2017-05-261-33/+37
| | | | | | | | | | | | | Clang supports coroutines in all dialects; Therefore libc++ should too, otherwise the Clang extension is unusable. I'm not convinced extending support to C++03 is a feasible long term plan, since as the library grows to offer things like generators it will be come increasingly difficult to limit the implementation to C++03. However for the time being supporting C++03 isn't a big deal. llvm-svn: 303963
* Guard <experimental/coroutine> against older Clang versions.Eric Fiselier2017-05-262-5/+9
| | | | | | | | | | | | | | Clang started providing -fcoroutines and defining __cpp_coroutines way before it implemented the __builtin_coro_foo functions. This means that simply checking if __cpp_coroutines is not a sufficient way of detecting the actual feature. This patch implements _LIBCPP_HAS_NO_COROUTINES which implements a slightly more complex feature check. Specifically it requires __cpp_coroutines >= 201703L, which only holds for Clang 5.0 built after 2017/05/24. llvm-svn: 303956
* Re-add <experimental/coroutine> to the module map.Eric Fiselier2017-05-252-9/+7
| | | | | | | | | | | | | The original issues were caused because <experimental/coroutine> didn't correctly #ifdef out enough of the header, which caused incomplete types to be used. This patch fixes the `#if defined(__cpp_coroutines)` guard and re-adds the headers to the module map. It also uglifies some incorrectly non-reserved names. llvm-svn: 303936
* libcxx: fix bootstrapping for mingw-w64Martell Malone2017-05-251-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D33388 llvm-svn: 303928
* Update more coroutine_handle signatures to reflect N4663.Eric Fiselier2017-05-251-3/+3
| | | | | | | Thanks to Casey Carter for pointing out the out-of-date tests and implementation. llvm-svn: 303900
* Update coroutine_handle<P>::promise to reflect N4663.Eric Fiselier2017-05-251-8/+2
| | | | | | | | | | | This patch updates the promise() member to match the current spec. Specifically it removes the non-const overload and make the return type of the const overload non-const. This patch also makes the ASSERT_NOT_NOEXCEPT tests libc++ specific, since other implementations may be free to strengthen the specification. llvm-svn: 303895
* Add support for shared_ptr<FunctionType>Erik Pilkington2017-05-251-12/+41
| | | | | | | | Fixes PR27566. Differential revision: https://reviews.llvm.org/D30837 llvm-svn: 303874
OpenPOWER on IntegriCloud