summaryrefslogtreecommitdiffstats
path: root/libcxx/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Add another test case to the deduction guide for basic_string.Marshall Clow2018-02-221-0/+11
| | | | llvm-svn: 325740
* [libcxx] Improve accuracy of complex asinh and acoshMikhail Maltsev2018-02-193-0/+99
| | | | | | | | | | | | | | | | | | | | 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-151-2/+1
| | | | 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
* Make the ctype_byname::widen test cases pass on FreeBSD.Dimitry Andric2018-02-132-2/+2
| | | | llvm-svn: 325028
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-1237-57/+57
| | | | llvm-svn: 324959
* Use multi-key tree search for {map, set}::{count, equal_range}Eric Fiselier2018-02-108-0/+442
| | | | | | | | | | | | | | | | | | | | | | | 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
* [libcxx] Avoid spurious construction of valarray elementsMikhail Maltsev2018-02-084-0/+81
| | | | | | | | | | | | | | | | | | | | | 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-082-0/+110
| | | | 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-071-2/+18
| | | | | | | | 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
* Fix PR#31454 - 'basic_string<T>::push_back() crashes if ↵Marshall Clow2018-02-071-2/+1
| | | | | | 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-0717-4/+651
| | | | | | | | | | | | | | | | | | | 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-0644-3365/+0
| | | | | | type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324423
* Revert "[libc++] Fix PR35491 - std::array of zero-size doesn't work with ↵Nirav Dave2018-02-067-206/+0
| | | | | | | | | | | 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-0582-16211/+0
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 324290
* Implement LWG 3014 - Fix more noexcept issues in filesystem.Eric Fiselier2018-02-043-4/+4
| | | | | | | | | 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
* 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-041-0/+33
| | | | | | | | | | | | | | | 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
* Address LWG 2849 and fix missing failure condition in copy_file.Eric Fiselier2018-02-041-1/+6
| | | | | | | Previously copy_file didn't handle the case where the input and output were the same file. llvm-svn: 324187
* correct comment about C++03 assignment operatorsEric Fiselier2018-02-041-4/+4
| | | | llvm-svn: 324186
* Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed.Eric Fiselier2018-02-044-0/+160
| | | | | | | | | | | | 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-044-0/+46
| | | | | | | | | | | | | | | | | | | 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
* Work around GCC constexpr initialization bugEric Fiselier2018-02-031-1/+1
| | | | llvm-svn: 324165
* Work around Clang bug introduced in r324062Eric Fiselier2018-02-031-0/+5
| | | | | | | | | | | When Clang encounters an already invalid class declaration, it can emit incorrect diagnostics about the exception specification on some of its members. This patch temporarily works around that incorrect diagnostic. The clang bug was introduced in r324062. llvm-svn: 324164
* Fix has_unique_object_representation after Clang commit r324134.Eric Fiselier2018-02-021-2/+4
| | | | | | | | | Clang previously reported an empty union as having a unique object representation. This was incorrect and was fixed in a recent Clang commit. This patch fixes the libc++ tests. llvm-svn: 324153
* Disable test in C++<11 mode due to use of alignas.Richard Smith2018-02-011-0/+2
| | | | llvm-svn: 324033
* Make std::get_temporary_buffer respect overaligned types when possibleRichard Smith2018-02-011-0/+33
| | | | | | | | 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-013-244/+0
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323979
* Remove <experimental/numeric>; use <numeric> instead. See ↵Marshall Clow2018-02-0118-607/+0
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323975
* Remove <experimental/any>; use <any> instead. See ↵Marshall Clow2018-02-0125-1982/+0
| | | | | | https://libcxx.llvm.org/TS_deprecation.html llvm-svn: 323972
* Remove <experimental/optional>; use <optional> instead. See ↵Marshall Clow2018-02-0169-4340/+0
| | | | | | 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-015-0/+133
| | | | | | 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-1/+1
| | | | llvm-svn: 323918
* Add tests to make sure that <string_view> provides std::size/data/empty in ↵Marshall Clow2018-01-305-1/+40
| | | | | | C++17 mode. This is LWG#3009, coming up for a vote in JAX - but we already do it, just don't have tests llvm-svn: 323719
* Fix the BinaryPredicate form of std::is_permutation to not rely on operator==Peter Collingbourne2018-01-261-0/+24
| | | | | | | | | | | | | | | | 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: Move #include_next <math.h> out of header guard in wrapper header.Peter Collingbourne2018-01-261-0/+23
| | | | | | | | | | | | | | | 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
* Fix PR35564 - std::list splice/erase incorrectly throw in debug mode.Eric Fiselier2018-01-251-0/+57
| | | | | | | | | | | | There was a bug in the implementation of splice where the container sizes were updated before decrementing one of the iterators. Afterwards, the result of decrementing the iterator was flagged as UB by the debug implementation because the container was reported to be empty. This patch fixes that bug by delaying the updating of the container sizes until after the iterators have been correctly constructed. llvm-svn: 323390
* Implement LWG2783: stack::emplace() and queue::emplace() should return ↵Marshall Clow2018-01-242-21/+59
| | | | | | decltype(auto) llvm-svn: 323385
* [libc++] Fix PR20855 -- libc++ incorrectly diagnoses illegal reference ↵Eric Fiselier2018-01-243-47/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | binding in std::tuple. Summary: See https://bugs.llvm.org/show_bug.cgi?id=20855 Libc++ goes out of it's way to diagnose `std::tuple` constructions which are UB due to lifetime bugs caused by reference creation. For example: ``` // The 'const std::string&' is created *inside* the tuple constructor, and its lifetime is over before the end of the constructor call. std::tuple<int, const std::string&> t(std::make_tuple(42, "abc")); ``` However, we are over-aggressive and we incorrectly diagnose cases such as: ``` void foo(std::tuple<int const&, int const&> const&); foo(std::make_tuple(42, 42)); ``` This patch fixes the incorrectly diagnosed cases, as well as converting the diagnostic to use the newly added Clang trait `__reference_binds_to_temporary`. The new trait allows us to diagnose cases we previously couldn't such as: ``` std::tuple<int, const std::string&> t(42, "abc"); ``` Reviewers: rsmith, mclow.lists Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41977 llvm-svn: 323380
* [libcxx] Correctly handle invalid regex character class namesMikhail Maltsev2018-01-241-0/+37
| | | | | | | | | | | | | | | | | | | | Summary: Currently when a regular expression contains an invalid character class name std::regex constructors throw an std::regex_error with std::regex_constants::error_brack code. This patch changes the code to std::regex_constants::error_ctype and adds a test. Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42291 llvm-svn: 323322
* include <cstdint> to get uint32_tMarshall Clow2018-01-241-0/+1
| | | | llvm-svn: 323306
* Implement P0463R1: 'Endian just Endian'. Reviewed as ↵Marshall Clow2018-01-241-0/+47
| | | | | | https://reviews.llvm.org/D35472 llvm-svn: 323296
* libcxx: Provide overloads for basic_filebuf::open() et al that take wchar_t* ↵Peter Collingbourne2018-01-239-0/+322
| | | | | | | | | | | | filenames on Windows. This is an MSVC standard library extension. It seems like a reasonable enough extension to me because wchar_t* is the native format for filenames on that platform. Differential Revision: https://reviews.llvm.org/D42225 llvm-svn: 323170
* Last batch of P0202 constexpr additions: includes/set_intersection/exchangeMarshall Clow2018-01-225-5/+116
| | | | llvm-svn: 323159
OpenPOWER on IntegriCloud