summaryrefslogtreecommitdiffstats
path: root/libcxx/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement filesystem::perm_options specified in NB comments.Eric Fiselier2018-03-261-11/+53
| | | | | | | | | | The NB comments for filesystem changed permissions and added a new enum `perm_options` which control how the permissions are applied. This implements than NB resolution llvm-svn: 328476
* Partially Revert "Workaround GCC bug PR78489 - SFINAE order is not respected."Eric Fiselier2018-03-231-12/+17
| | | | | | | | | | This partially reverts commit r328261. The GCC bug has been fixed in trunk and has never existed in a released version. Therefore the changes to variant are unneeded. However, the additional tests have been left in place. llvm-svn: 328388
* Workaround GCC bug PR78489 - SFINAE order is not respected.Eric Fiselier2018-03-221-17/+12
| | | | | | | | | | | This patch works around variant test failures which are new to GCC 8. GCC 8 either doesn't perform SFINAE in lexical order, or it doesn't halt after encountering the first failure. This causes hard error to occur instead of substitution failure. See gcc.gnu.org/PR78489 llvm-svn: 328261
* Fix improperly failing test - and the code it was testing. Thanks to Stephan ↵Marshall Clow2018-03-221-3/+1
| | | | | | Lavavej for the catch. llvm-svn: 328225
* Fix dynarray test failures after changing __libcpp_allocate/deallocateEric Fiselier2018-03-221-7/+8
| | | | llvm-svn: 328182
* Fix PR22634 - std::allocator doesn't respect over-aligned types.Eric Fiselier2018-03-225-56/+93
| | | | | | | | | | | | | | | | | | | | This patch fixes std::allocator, and more specifically, all users of __libcpp_allocate and __libcpp_deallocate, to support over-aligned types. __libcpp_allocate/deallocate now take an alignment parameter, and when the specified alignment is greater than that supported by malloc/new, the aligned version of operator new is called (assuming it's available). When aligned new isn't available, the old behavior has been kept, and the alignment parameter is ignored. This patch depends on recent changes to __builtin_operator_new/delete which allow them to be used to call any regular new/delete operator. By using __builtin_operator_new/delete when possible, the new/delete erasure optimization is maintained. llvm-svn: 328180
* Implement LWG3034: P0767R1 breaks previously-standard-layout typesMarshall Clow2018-03-212-4/+8
| | | | llvm-svn: 328064
* Implement LWG3035: std::allocator's constructors should be constexpr.Marshall Clow2018-03-201-7/+18
| | | | llvm-svn: 328059
* Implement LWG 3039 and 3041 - 'Treating Unnecessary decay'.Marshall Clow2018-03-202-5/+5
| | | | llvm-svn: 328054
* [CMake] Copy the generated __config header into build directoryPetr Hosek2018-03-101-14/+26
| | | | | | | | | | | | | | When the generated __config file is being used, it is currently only copied during installation process. However, that means that the file that gets copied into LLVM build directory is the vanilla __config file, and any parts of the build that depend on the just built toolchain like sanitizers will get that instead of the generated version. To avoid this issue, we need to copy the generated header into the LLVM build directory as well. Differential Revision: https://reviews.llvm.org/D43797 llvm-svn: 327194
* Low-hanging fruit optimization in string::__move_assign().Vedant Kumar2018-03-081-6/+21
| | | | | | | | | | | | | | | shrink_to_fit() ends up doing a lot work to get information that we already know since we just called clear(). This change seems concise enough to be worth the couple extra lines and my benchmarks show that it is indeed a pretty decent win. It looks like the same thing is going on twice in __copy_assign_alloc(), but I didn't want to go overboard since this is my first contribution to llvm/libc++. Patch by Timothy VanSlyke! Differential Revision: https://reviews.llvm.org/D41976 llvm-svn: 327064
* Implement LWG#2518 - Non-member swap for propagate_const should call member swapMarshall Clow2018-03-081-2/+1
| | | | llvm-svn: 327005
* Cleanup __config indention NFCLogan Chien2018-02-241-420/+432
| | | | | | | | | | | | | | | | | | This commit indents each level by two space characters, e.g. #if defined(CONDITION) # define _LIBCPP_NAME VALUE #else # define _LIBCPP_NAME VALUE #endif The simple #ifndef, #define, and #endif sequences are not indented, e.g. #ifndef _LIBCPP_NAME #define _LIBCPP_NAME ... #endif llvm-svn: 326027
* [libcxx] Do not include the C math.h header before __configMikhail Maltsev2018-02-221-10/+16
| | | | | | | | | | | | | | | | | | | | | | Summary: Certain C libraries require configuration macros defined in __config to provide the correct functionality for libc++. This patch ensures that the C header math.h is always included after the __config header. It also adds a Windows-specific #if guard for the case when the C math.h file is included the second time, as suggested by Marshall in https://reviews.llvm.org/rL323490. Fixes PR36382. Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: cfe-commits, pcc, christof, rogfer01 Differential Revision: https://reviews.llvm.org/D43579 llvm-svn: 325760
* libcxx: Unbreak external thread library configuration.Peter Collingbourne2018-02-211-12/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D42503 llvm-svn: 325723
* [libcxx] Improve accuracy of complex asinh and acoshMikhail Maltsev2018-02-191-3/+14
| | | | | | | | | | | | | | | | | | | | Summary: Currently std::asinh and std::acosh use std::pow to compute x^2. This results in a significant error when computing e.g. asinh(i) or acosh(-1). This patch expresses x^2 directly via x.real() and x.imag(), like it is done in libstdc++/glibc, and adds tests that checks the accuracy. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D41629 llvm-svn: 325510
* Fix incorrect indentation.Bruce Mitchener2018-02-141-1/+1
| | | | | | | | | | Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43167 llvm-svn: 325087
* Put type attributes after class keywordDimitry Andric2018-02-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Compiling `<functional>` in C++17 or higher mode results in: ``` functional:2500:1: warning: attribute '__visibility__' is ignored, place it after "class" to apply attribute to type declaration [-Wignored-attributes] _LIBCPP_TYPE_VIS ^ __config:701:46: note: expanded from macro '_LIBCPP_TYPE_VIS' # define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) ^ 1 warning generated. ``` Fix it by putting the attribute after the `class` keyword. Reviewers: EricWF, mclow.lists Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43209 llvm-svn: 325027
* Implement LWG 2835 - fix <tgmath.h>Marshall Clow2018-02-121-4/+12
| | | | llvm-svn: 324923
* Implement LWG#2908 - The less-than operator for shared pointers could do ↵Marshall Clow2018-02-121-0/+5
| | | | | | more, and mark 2878 as complete as well (we already do that) llvm-svn: 324911
* While implementing P0777 - preventing unnecessary decay, I found some ↵Marshall Clow2018-02-122-11/+11
| | | | | | non-public uses of decay that could be replaced by __uncvref. NFC intented llvm-svn: 324895
* Fix libcxx MSVC C++17 redefinition of 'align_val_t'Eric Fiselier2018-02-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch from charlieio@outlook.com Reviewed as https://reviews.llvm.org/D42354 When the following command is used: > clang-cl -std:c++17 -Iinclude\c++\v1 hello.cc c++.lib An error occurred: In file included from hello.cc:1: In file included from include\c++\v1\iostream:38: In file included from include\c++\v1\ios:216: In file included from include\c++\v1\__locale:15: In file included from include\c++\v1\string:477: In file included from include\c++\v1\string_view:176: In file included from include\c++\v1\__string:56: In file included from include\c++\v1\algorithm:643: In file included from include\c++\v1\memory:656: include\c++\v1\new(165,29): error: redefinition of 'align_val_t' enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; ^ C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vcruntime_new.h(43,16): note: previous definition is here enum class align_val_t : size_t {}; ^ 1 error generated. vcruntime_new.h has defined align_val_t, libcxx need hide align_val_t. This patch fixes that error. llvm-svn: 324853
* Fix a typo in the synopsis comment. NFC. Thanks to K-ballo for the catchMarshall Clow2018-02-111-1/+1
| | | | llvm-svn: 324851
* Use multi-key tree search for {map, set}::{count, equal_range}Eric Fiselier2018-02-102-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Patch from ngolovliov@gmail.com Reviewed as: https://reviews.llvm.org/D42344 As described in llvm.org/PR30959, the current implementation of std::{map, key}::{count, equal_range} in libcxx is non-conforming. Quoting the C++14 standard [associative.reqmts]p3 > The phrase “equivalence of keys” means the equivalence relation imposed by > the comparison and not the operator== on keys. That is, two keys k1 and k2 are > considered to be equivalent if for the comparison object comp, > comp(k1, k2) == false && comp(k2, k1) == false. In the same section, the requirements table states the following: > a.equal_range(k) equivalent to make_pair(a.lower_bound(k), a.upper_bound(k)) > a.count(k) returns the number of elements with key equivalent to k The behaviour of libstdc++ seems to conform to the standard here. llvm-svn: 324799
* [libcxx] Avoid spurious construction of valarray elementsMikhail Maltsev2018-02-081-21/+58
| | | | | | | | | | | | | | | | | | | | | Summary: Currently libc++ implements some operations on valarray by using the resize method. This method has a parameter with a default value. Because of this, valarray may spuriously construct and destruct objects of valarray's element type. This patch fixes this issue and adds corresponding test cases. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: rogfer01, cfe-commits Differential Revision: https://reviews.llvm.org/D41992 llvm-svn: 324596
* Implement deduction guide for basic_string as described in P0433Marshall Clow2018-02-081-0/+19
| | | | llvm-svn: 324569
* Fix size and alignment of array<T, 0>.Eric Fiselier2018-02-072-2/+4
| | | | | | | | An array T[1] isn't necessarily the same say when it's a member of a struct. This patch addresses that problem and corrects the tests to deal with it. llvm-svn: 324545
* Stop using __strtonum_fallback on Android.Dan Albert2018-02-071-1/+0
| | | | | | | Fallback implementations are now provided by bionic when necessary, which these may conflict with. llvm-svn: 324534
* Fix PR#31454 - 'basic_string<T>::push_back() crashes if ↵Marshall Clow2018-02-071-3/+7
| | | | | | sizeof(T)>sizeof(long long)'. We were mishandling the small-string optimization calculations for very large 'characters'. This may be an ABI change (change the size of) strings of very large 'characters', but since they never worked, I'm not too concerned. llvm-svn: 324531
* [libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default ↵Eric Fiselier2018-02-072-22/+154
| | | | | | | | | | | | | | | | | | | constructible types. Summary: This patch fixes llvm.org/PR35491 and LWG2157 (https://cplusplus.github.io/LWG/issue2157) The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: lichray, cfe-commits Differential Revision: https://reviews.llvm.org/D41223 llvm-svn: 324526
* Remove more of the std::experimental bits that are now in std::. All the _v ↵Marshall Clow2018-02-066-632/+4
| | | | | | type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324423
* Implement P0777: Treating unnecessay decayMarshall Clow2018-02-064-14/+12
| | | | llvm-svn: 324398
* Fix misleading indentation; replace a couple of NULLs with nullptr. Resolves ↵Marshall Clow2018-02-062-7/+7
| | | | | | https://reviews.llvm.org/D42945 ; thanks to Bruce Mitchener for the patch. llvm-svn: 324378
* Revert "[libc++] Fix PR35491 - std::array of zero-size doesn't work with ↵Nirav Dave2018-02-061-70/+17
| | | | | | | | | | | non-default constructible types." Revert "Fix initialization of array<const T, 0> with GCC." Revert "Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed." This reverts commit r324182, r324185, and r324194 which were causing issues with zero-length std::arrays. llvm-svn: 324309
* Remove <experimental/string_view>; use <string_view> instead. See ↵Marshall Clow2018-02-052-812/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324290
* Fix initialization of array<const T, 0> with GCC.Eric Fiselier2018-02-041-8/+6
| | | | | | | | | | | | Previously, when handling zero-sized array of const objects we used a const version of aligned_storage_t, which is not an array type. However, GCC complains about initialization of the form: array<const T, 0> arr = {}; This patch fixes that bug by making the dummy object used to represent the zero-sized array an array itself. This avoids GCC's complaints about the uninitialized const member. llvm-svn: 324194
* Implement LWG 3014 - Fix more noexcept issues in filesystem.Eric Fiselier2018-02-041-8/+8
| | | | | | | | | This patch removes the noexcept declaration from filesystem operations which require creating temporary paths or creating a directory iterator. Either of these operations can throw. llvm-svn: 324192
* Implement LWG2989: path's streaming operators allow everything under the sun.Eric Fiselier2018-02-041-35/+37
| | | | | | | | | | | | | | | Because path can be constructed from a ton of different types, including string and wide strings, this caused it's streaming operators to suck up all sorts of silly types via silly conversions. For example: using namespace std::experimental::filesystem::v1; std::wstring w(L"wide"); std::cout << w; // converts to path. This patch tentatively adopts the resolution to LWG2989 and fixes the issue by making the streaming operators friends of path. llvm-svn: 324189
* Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed.Eric Fiselier2018-02-041-10/+21
| | | | | | | | | | | | The standard isn't exactly clear how std::array should handle zero-sized arrays with const element types. In particular W.R.T. copy assignment, swap, and fill. This patch takes the position that those operations should be ill-formed, and makes changes to libc++ to make it so. This follows up on commit r324182. llvm-svn: 324185
* [libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default ↵Eric Fiselier2018-02-041-16/+60
| | | | | | | | | | | | | | | | | | | constructible types. Summary: This patch fixes llvm.org/PR35491 and LWG2157 (https://cplusplus.github.io/LWG/issue2157) The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`. Reviewers: mclow.lists, EricWF Reviewed By: EricWF Subscribers: lichray, cfe-commits Differential Revision: https://reviews.llvm.org/D41223 llvm-svn: 324182
* Make std::get_temporary_buffer respect overaligned types when possibleRichard Smith2018-02-011-1/+48
| | | | | | | | Patch by Chris Kennelly! Differential Revision: https://reviews.llvm.org/D41746 llvm-svn: 324020
* Remove std::experimental::sample; use std::sample instead. See ↵Marshall Clow2018-02-011-15/+2
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323979
* Remove <experimental/numeric>; use <numeric> instead. See ↵Marshall Clow2018-02-012-113/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323975
* Remove <experimental/any>; use <any> instead. See ↵Marshall Clow2018-02-012-586/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323972
* Remove <experimental/optional>; use <optional> instead. See ↵Marshall Clow2018-02-012-916/+1
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323971
* Add static_asserts to basic_ios and basic_stream_buf to ensure that that the ↵Marshall Clow2018-02-012-0/+6
| | | | | | traits match the character type. This is a requirement on the user - now we get consistent failures at compile time instead of incomprehensible error messages or runtime failures. This is also LWG#2994 - not yet adopted. llvm-svn: 323945
* Implement LWG2870: Default value of parameter theta of polar should be dependentMarshall Clow2018-01-311-2/+2
| | | | llvm-svn: 323918
* Fix the BinaryPredicate form of std::is_permutation to not rely on operator==Peter Collingbourne2018-01-261-2/+10
| | | | | | | | | | | | | | | | According to [1], forms 2 and 4 of std::is_permutation should use the passed in binary predicate to compare elements. operator== should only be used for forms 1 and 3 which do not take a binary predicate. This CL fixes forms 2 and 4 which relied on operator== for some comparisons. [1] http://en.cppreference.com/w/cpp/algorithm/is_permutation Patch by Thomas Anderson! Differential Revision: https://reviews.llvm.org/D42518 llvm-svn: 323563
* libcxx: Use vcruntime declarations for typeinfo on Windows.Peter Collingbourne2018-01-261-0/+6
| | | | | | | | | | | We need to use the vcruntime declarations on Windows to avoid an ODR violation involving rtti.obj, which provides the definition of the runtime function implementing dynamic_cast and depends on the vcruntime implementations of bad_cast and bad_typeid. Differential Revision: https://reviews.llvm.org/D42220 llvm-svn: 323491
* libcxx: Move #include_next <math.h> out of header guard in wrapper header.Peter Collingbourne2018-01-261-2/+10
| | | | | | | | | | | | | | | Code on Windows expects to be able to do: #define _USE_MATH_DEFINES #include <math.h> and receive the definitions of mathematical constants, even if <math.h> has previously been included. To support this scenario, re-include <math.h> every time the wrapper header is included. Differential Revision: https://reviews.llvm.org/D42403 llvm-svn: 323490
OpenPOWER on IntegriCloud