summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
Commit message (Collapse)AuthorAgeFilesLines
* Mark destroying delete test as UNSUPPORTED with clang 7Eric Fiselier2019-07-121-1/+1
| | | | llvm-svn: 365856
* Fix memory leak in set and map.Eric Fiselier2019-07-112-10/+53
| | | | | | | | When assigning an initializer list into set/map, libc++ would leak memory if the initializer list contained equivalent keys because we failed to check if the insertion was successful. llvm-svn: 365840
* [libc++] Implement deduction guides for <unordered_set>Louis Dionne2019-07-114-0/+586
| | | | | | | Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58617 llvm-svn: 365788
* Make forward_list::remove/remove_if/unique all return void before C++20; ↵Marshall Clow2019-07-084-62/+124
| | | | | | undoes that bit of D58332. Thanks to Mikhail Maltsev for pointing this out llvm-svn: 365290
* Fix PR27658 - Make ~mutex trivial when possible.Eric Fiselier2019-07-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently std::mutex has a constexpr constructor, but a non-trivial destruction. The constexpr constructor is required to ensure the construction of a mutex with static storage duration happens at compile time, during constant initialization, and not during dynamic initialization. This means that static mutex's are always initialized and can be used safely during dynamic initialization without the "static initialization order fiasco". A trivial destructor is important for similar reasons. If a mutex is used during dynamic initialization it might also be used during program termination. If a static mutex has a non-trivial destructor it will be invoked during termination. This can introduce the "static deinitialization order fiasco". Additionally, function-local statics emit a guard variable around non-trivially destructible types. This results in horrible codegen and adds a runtime cost to every call to that function. non-local static's also result in slightly worse codegen but it's not as big of a problem. Example codegen can be found here: https://goo.gl/3CSzbM Note: This optimization is not safe with every pthread implementation. Some implementations allocate on the first call to pthread_mutex_lock and free the allocation in pthread_mutex_destroy. Also, changing the triviality of the destructor is not an ABI break. At least to the best of my knowledge :-) llvm-svn: 365273
* Make list::remove/remove_if/unique all return void before C++20; undoes that ↵Marshall Clow2019-07-064-19/+84
| | | | | | bit of D58332. Thanks to Mikhail Maltsev for pointing this out llvm-svn: 365261
* This patch makes swap functions constexpr. Both swap overloads, swap_ranges ↵Zoe Carver2019-07-054-0/+65
| | | | | | and iter_swap are updated (with tests). llvm-svn: 365238
* Add tests for regex_match ambiguity (aka LWG2273). NFC. Reviewed as ↵Marshall Clow2019-07-032-0/+48
| | | | | | https://reviews.llvm.org/D63051 llvm-svn: 365080
* Fix tuple's conditionally explicit constructors for very weird userEric Fiselier2019-07-031-0/+14
| | | | | | | | | | | | types. It seems some people like to write types that can explicitly convert to anything, but cannot be used to explicitly construct anything. This patch makes tuple tolerate such types, as is required by the standard. llvm-svn: 365074
* Bit Operations: P0556, P0553 and P1355. Reviewed as: ↵Marshall Clow2019-07-0113-0/+1904
| | | | | | https://reviews.llvm.org/D51262 llvm-svn: 364862
* Ensure bitset's string constructor doesn't poison the overload set.Eric Fiselier2019-07-011-0/+13
| | | | llvm-svn: 364842
* Implement P0646R1: Erase-Like Algorithms Should Return size_type. Reviewed ↵Marshall Clow2019-07-016-41/+41
| | | | | | as https://reviews.llvm.org/D58332, and then updated because I rewrote a couple of those routines to eliminate some UB. Thanks to Zoe for tghe patch. llvm-svn: 364840
* Implement LWG2221: 'Formatted output for nullptr_t' Reviewed as: ↵Marshall Clow2019-07-011-0/+7
| | | | | | https://reviews.llvm.org/D63053 llvm-svn: 364802
* [libcxx] [test] Add void cast to result of compare_exchange_weak to suppress ↵Billy Robert O'Neal III2019-07-011-4/+4
| | | | | | [[nodiscard]]. llvm-svn: 364732
* Add a missing '__uncvref_t' to the SFINAE constraints for optional's ↵Marshall Clow2019-06-271-0/+12
| | | | | | assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report llvm-svn: 364574
* Followup to revision 364545: Turns out that clang issues different errors ↵Marshall Clow2019-06-272-2/+2
| | | | | | for C++11 vs c++2a, so I tweaked the 'expected-error' bits that I added to match either of them. llvm-svn: 364554
* Provide hashers for string_view only if they are using the default ↵Marshall Clow2019-06-272-1/+68
| | | | | | char_traits. Seen on SO: test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp llvm-svn: 364545
* Fix test failures due to modified wording in Clang diagnostics.Richard Smith2019-06-242-4/+4
| | | | llvm-svn: 364241
* Fix test failures when using a custom ABI namespace.Richard Smith2019-06-242-3/+3
| | | | llvm-svn: 364239
* Use C++11 implementation of unique_ptr in C++03.Eric Fiselier2019-06-231-4/+0
| | | | llvm-svn: 364161
* Implement P0340R3: Make 'underlying_type' SFINAE-friendly. Reviewed as ↵Marshall Clow2019-06-212-20/+106
| | | | | | https://reviews.llvm.org/D63574 llvm-svn: 364094
* Use rvalue references throughout the is_constructible traits.Eric Fiselier2019-06-213-6/+3
| | | | llvm-svn: 364065
* Make move and forward work in C++03.Eric Fiselier2019-06-216-102/+29
| | | | | | | | | | | | | | | | | | | | | 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
* Enable aligned_union in C++03Eric Fiselier2019-06-211-2/+0
| | | | llvm-svn: 364058
* Get is_convertible tests passing in C++03 (except the fallback).Eric Fiselier2019-06-212-8/+3
| | | | llvm-svn: 364057
* Make rvalue metaprogramming traits work in C++03.Eric Fiselier2019-06-219-23/+0
| | | | | | The next step is to get move and forward working in C++03. llvm-svn: 364053
* [libc++] Recommit r363692 to implement P0608R3Zhihao Yuan2019-06-204-3/+207
| | | | | | | | | | | | Re-apply the change which was reverted in r363764 as-is after breakages being resolved. Thanks Eric Fiselier for working hard on this. See also: https://bugs.llvm.org/show_bug.cgi?id=42330 Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363993
* [libc++] Take 2: Implement CTAD for map and multimapLouis Dionne2019-06-206-0/+702
| | | | | | | | | | | This is a re-application of r362986 (which was reverted in r363688) with fixes for the issue that caused it to be reverted. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58587 llvm-svn: 363968
* AIX system headers need stdint.h and inttypes.h to be re-enterableXing Xue2019-06-201-0/+268
| | | | | | | | | | | | | | | | | Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 llvm-svn: 363939
* [libc++] Revert r363692 which implements P0608R3Zhihao Yuan2019-06-194-207/+3
| | | | | | | The change caused a large number of compiler failures in Google's codebase. People need time to evaluate the impact. llvm-svn: 363764
* Disable the 'nextafter' portions of these tests on PPC when using 128-bit ↵Marshall Clow2019-06-181-19/+27
| | | | | | doubles because the 'nextafter' call doesn't work right. Reviewed as https://reviews.llvm.org/D62384. Thanks to Xing Xue for the patch, and Hubert for the explanation. llvm-svn: 363740
* Fix the floating point version of midpoint. It wasn't constexpr, among other ↵Marshall Clow2019-06-181-5/+16
| | | | | | things. Add more tests. As a drive-by, the LCD implementation had a class named '__abs' which did a 'absolute value to a common-type' conversion. Rename that to be '__ct_abs'. llvm-svn: 363714
* [libc++] Implement P0608R3 - A sane variant converting constructorZhihao Yuan2019-06-184-3/+207
| | | | | | | | | | | | | | | | | | Summary: Prefer user-defined conversions over narrowing conversions and conversions to bool. References: http://wg21.link/p0608 Reviewers: EricWF, mpark, mclow.lists Reviewed By: mclow.lists Subscribers: zoecarver, ldionne, libcxx-commits, cfe-commits, christof Differential Revision: https://reviews.llvm.org/D44865 llvm-svn: 363692
* [libc++] Re-apply XFAIL to is_base_of test that was inadvertently revertedLouis Dionne2019-06-181-4/+5
| | | | llvm-svn: 363689
* [libc++] Revert the addition of map/multimap CTADLouis Dionne2019-06-187-704/+1
| | | | | | | | | | | | | This was found to be broken on Clang trunk. This is a revert of the following commits (the subsequent commits added XFAILs to the tests that were missing from the original submission): r362986: Implement deduction guides for map/multimap. r363014: Add some XFAILs r363097: Add more XFAILs r363197: Add even more XFAILs llvm-svn: 363688
* Add tests for LWG 3206. NFCMarshall Clow2019-06-171-0/+23
| | | | llvm-svn: 363589
* [libcxx] Add XFAIL for facet test when back-deploying to older macOSLouis Dionne2019-06-141-0/+10
| | | | llvm-svn: 363405
* [libc++] Add missing #include in <cwchar> testsLouis Dionne2019-06-132-0/+2
| | | | | | | Thanks to Mikhail Maltsev for the patch. Differential Revision: https://reviews.llvm.org/D63289 llvm-svn: 363290
* [libcxx] XFAIL set/multiset CTAD tests on Apple Clang 10Louis Dionne2019-06-122-2/+2
| | | | llvm-svn: 363209
* [libcxx] XFAIL some CTAD tests on AppleClang 10Louis Dionne2019-06-122-2/+2
| | | | | | | AppleClang 10 doesn't contain some changes that are required for this test to give the right error message. llvm-svn: 363197
* Move libc++ specific tests for std::function out of the std directoryEric Fiselier2019-06-112-94/+0
| | | | llvm-svn: 363111
* [libcxx] Mark CTAD tests for set and multiset as unsupported on older Apple ↵Louis Dionne2019-06-112-0/+2
| | | | | | | | Clangs Those fail on Green Dragon. llvm-svn: 363107
* Mark CTAD fail tests for set/multiset as XFAIL for older compilers that give ↵Marshall Clow2019-06-112-0/+4
| | | | | | different error messages llvm-svn: 363099
* XFAIL a couple of tests on apple-clang-9.1, which is a compiler that I ↵Marshall Clow2019-06-113-3/+4
| | | | | | didn't know existed llvm-svn: 363097
* [libc++] Implement deduction guides for <set>Louis Dionne2019-06-114-0/+516
| | | | | | | | | | This is part of C++17's P0433. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58582 llvm-svn: 363090
* [libcxx] Slightly improved policy for handling experimental featuresLouis Dionne2019-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: Following the discussion on the libcxx-dev mailing list (http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html), this implements the new policy for handling experimental features and their deprecation. We basically add a deprecation warning for std::experimental::filesystem, and we remove a bunch of <experimental/*> headers that were now empty. Reviewers: mclow.lists, EricWF Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits, jfb Tags: #libc Differential Revision: https://reviews.llvm.org/D62428 llvm-svn: 363072
* Add a test for is_base_of and incomplete types. Because this trait uses a ↵Marshall Clow2019-06-111-0/+92
| | | | | | compiler intrinsic which was broken in many clangs, have lots of XFAILs. llvm-svn: 363029
* XFAIL a couple of CTAD tests on clang-6; it gives different error messages ↵Marshall Clow2019-06-112-0/+4
| | | | | | than clang 7/8/9 llvm-svn: 363014
* Implement deduction guides for map/multimap. Reviewed as ↵Marshall Clow2019-06-106-0/+698
| | | | | | https://reviews.llvm.org/D58587. Thanks to Quuxplusone for the submission. llvm-svn: 362986
* [libc++] Fix leading zeros in std::to_charsZhihao Yuan2019-06-101-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: It is a bugfix proposal for https://bugs.llvm.org/show_bug.cgi?id=42166. `std::to_chars` appends leading zeros if input 64-bit value has 9, 10 or 11 digits. According to documentation `std::to_chars` must not append leading zeros: https://en.cppreference.com/w/cpp/utility/to_chars Changeset should not affect `std::to_chars` performance: http://quick-bench.com/CEpRs14xxA9WLvkXFtaJ3TWOVAg Unit test that `std::from_chars` supports compatibility for both `std::to_chars` outputs (previous and fixed one) already exists: https://github.com/llvm-mirror/libcxx/blob/1f60111b597e5cb80a4513ec86f79b7e137f7793/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp#L63 Reviewers: lichray, mclow.lists, ldionne, EricWF Reviewed By: lichray, mclow.lists Subscribers: zoecarver, christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D63047 llvm-svn: 362967
OpenPOWER on IntegriCloud