summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Add another test case to the deduction guide for basic_string.Marshall Clow2018-02-221-0/+11
| | | | llvm-svn: 325740
* 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-194-3/+113
| | | | | | | | | | | | | | | | | | | | 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 test failure on compilers w/o deduction guidesEric Fiselier2018-02-152-3/+3
| | | | llvm-svn: 325205
* Add a catch for std::length_error for the case where the string can't handle ↵Marshall Clow2018-02-141-6/+7
| | | | | | 2GB. (like say 32-bit big-endian) llvm-svn: 325147
* 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
* Make the ctype_byname::widen test cases pass on FreeBSD.Dimitry Andric2018-02-132-2/+2
| | | | llvm-svn: 325028
* 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
* Fix typos.Bruce Mitchener2018-02-132-2/+2
| | | | | | | | | | Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43224 llvm-svn: 324989
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-1237-57/+57
| | | | llvm-svn: 324959
* Implement LWG 2835 - fix <tgmath.h>Marshall Clow2018-02-122-5/+13
| | | | llvm-svn: 324923
* Implement LWG#2908 - The less-than operator for shared pointers could do ↵Marshall Clow2018-02-122-3/+8
| | | | | | 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
* Add default C++ ABI libname and include paths for FreeBSDDimitry Andric2018-02-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As noted in a discussion about testing the LLVM 6.0.0 release candidates (with libc++) for FreeBSD, many tests turned out to fail with "exception_ptr not yet implemented". This was because libc++ did not choose the correct C++ ABI library, and therefore it fell back to the `exception_fallback.ipp` header. Since FreeBSD 10.x, we have been using libcxxrt as our C++ ABI library, and its headers have always been installed in /usr/include/c++/v1, together with the (system) libc++ headers. (Older versions of FreeBSD used GNU libsupc++ by default, but these are now unsupported.) Therefore, if we are building libc++ for FreeBSD, set: * `LIBCXX_CXX_ABI_LIBNAME` to "libcxxrt" * `LIBCXX_CXX_ABI_INCLUDE_PATHS` to "/usr/include/c++/v1" by default. Reviewers: emaste, EricWF, mclow.lists Reviewed By: EricWF Subscribers: mgorny, cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D43166 llvm-svn: 324855
* 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
* Mark two issues as completeEric Fiselier2018-02-111-4/+4
| | | | llvm-svn: 324852
* 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-1010-6/+448
| | | | | | | | | | | | | | | | | | | | | | | 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
* The apple versions of clang don't support deduction guides yet.Marshall Clow2018-02-082-0/+2
| | | | llvm-svn: 324640
* Once more, with feeling. Spell 'clang-4.0' correctly this timeMarshall Clow2018-02-082-2/+2
| | | | llvm-svn: 324624
* Clean up string's deduction guides tests. Mark old versions of clang as ↵Marshall Clow2018-02-083-58/+83
| | | | | | unsupported, b/c they don't have deduction guides, even in C++17 mode llvm-svn: 324619
* Update the status of removed componentsMarshall Clow2018-02-081-14/+14
| | | | llvm-svn: 324609
* [libcxx] Avoid spurious construction of valarray elementsMikhail Maltsev2018-02-085-21/+139
| | | | | | | | | | | | | | | | | | | | | 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
* Temporarily comment out deduction guide tests while I figure out what to do ↵Marshall Clow2018-02-082-0/+3
| | | | | | with old bots llvm-svn: 324573
* Implement deduction guide for basic_string as described in P0433Marshall Clow2018-02-084-2/+132
| | | | llvm-svn: 324569
* Improve a test. NFCMarshall Clow2018-02-081-0/+1
| | | | llvm-svn: 324566
* Fix size and alignment of array<T, 0>.Eric Fiselier2018-02-073-4/+22
| | | | | | | | 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-072-5/+8
| | | | | | 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
* Fix -verify static assert messages for older Clang versionsEric Fiselier2018-02-072-2/+2
| | | | llvm-svn: 324529
* [libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default ↵Eric Fiselier2018-02-0719-26/+805
| | | | | | | | | | | | | | | | | | | 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
* Comment on 'Review' issuesMarshall Clow2018-02-071-8/+8
| | | | llvm-svn: 324503
* Remove more of the std::experimental bits that are now in std::. All the _v ↵Marshall Clow2018-02-0650-3997/+4
| | | | | | type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324423
* Mark P0777 as completeMarshall Clow2018-02-061-2/+2
| | | | llvm-svn: 324399
* Implement P0777: Treating unnecessay decayMarshall Clow2018-02-064-14/+12
| | | | llvm-svn: 324398
* Fix building libc++ with the macOS 10.13 SDK with -mmacosx-version-min=10.12 ↵Nico Weber2018-02-061-4/+29
| | | | | | | | | | | | | | | | | or lower. The 10.13 SDK always defines utimensat() (with an availability(macosx=10.13) annotation) and unconditionally defines UTIME_OMIT, so use the compile-time availability macros on Apple platforms instead. For people statically linking libc++, it might make sense to also provide an opt-in option for using __builtin_available() to dynamically check for the OS version, but for now let's do the smallest thing needed to unbreak the build. Based on a patch by Eric Fiselier <eric@efcs.ca>: https://reviews.llvm.org/D34249 Fixes PR33469. llvm-svn: 324385
* 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
* No, really this time mark 3034 as 'Patch Ready'Marshall Clow2018-02-061-2/+2
| | | | llvm-svn: 324312
* Mark issue 3034 as 'Patch Ready'Marshall Clow2018-02-061-2/+2
| | | | llvm-svn: 324310
* Revert "[libc++] Fix PR35491 - std::array of zero-size doesn't work with ↵Nirav Dave2018-02-068-276/+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
* More patches readyMarshall Clow2018-02-061-7/+7
| | | | llvm-svn: 324307
* Add issues in 'Review'Marshall Clow2018-02-051-3/+23
| | | | llvm-svn: 324292
* Remove <experimental/string_view>; use <string_view> instead. See ↵Marshall Clow2018-02-0584-17023/+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
* Mark LWG 3014 as complete. No code changes neededEric Fiselier2018-02-041-2/+2
| | | | llvm-svn: 324193
* Implement LWG 3014 - Fix more noexcept issues in filesystem.Eric Fiselier2018-02-045-14/+14
| | | | | | | | | 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
* Mark LWG 3013 as already complete. See r316941Eric Fiselier2018-02-041-2/+2
| | | | llvm-svn: 324191
* Remove debug println from rec.dir.itr.increment testEric Fiselier2018-02-041-2/+0
| | | | llvm-svn: 324190
* Implement LWG2989: path's streaming operators allow everything under the sun.Eric Fiselier2018-02-043-37/+72
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud