summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers
Commit message (Collapse)AuthorAgeFilesLines
...
* First half of C++17's splicing maps and setsErik Pilkington2018-08-0133-0/+2380
| | | | | | | | | | | | | This commit adds a node handle type, (located in __node_handle), and adds extract() and insert() members to all map and set types, as well as their implementations in __tree and __hash_table. The second half of this feature is adding merge() members, which splice nodes in bulk from one container into another. This will be committed in a follow-up. Differential revision: https://reviews.llvm.org/D46845 llvm-svn: 338472
* Disable 'suggest braces' warnings for std::array in testsMarshall Clow2018-07-242-0/+7
| | | | llvm-svn: 337808
* Implement <span>. Reviewed as https://reviews.llvm.org/D49338Marshall Clow2018-07-2438-0/+4408
| | | | llvm-svn: 337804
* Fix a couple of 'unused variable' warnings in a vector test. NFC.Marshall Clow2018-07-131-0/+4
| | | | llvm-svn: 337016
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2018-06-1414-29/+29
| | | | llvm-svn: 334676
* Fix test failures after r334053.Eric Fiselier2018-06-066-9/+20
| | | | llvm-svn: 334056
* Fix PR37694 - std::vector doesn't correctly move construct allocators.Eric Fiselier2018-06-053-0/+161
| | | | | | | | | | | | | | | | | | | C++2a[container.requirements.general]p8 states that when move constructing a container, the allocator is move constructed. Vector previously copy constructed these allocators. This patch fixes that bug. Additionally it cleans up some unnecessary allocator conversions when copy constructing containers. Libc++ uses __internal_allocator_traits::select_on_copy_construction to select the correct allocator during copy construction, but it unnecessarily converted the resulting allocator to the user specified allocator type and back. After this patch list and forward_list no longer do that. Technically we're supposed to be using allocator_traits<allocator_type>::select_on_copy_construction, but that should seemingly be addressed as a separate patch, if at all. llvm-svn: 334053
* Mark deduction guide tests as failing on apple-clang-9JF Bastien2018-05-293-3/+3
| | | | | | | As discussed here: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058116.html The tests fail on clang-5, as well as apple-clang-9. Mark them as such. llvm-svn: 333479
* Fix up the final bits of breakage due to clang v5 generating bad implicit ↵Marshall Clow2018-05-281-3/+3
| | | | | | template deduction guides - specifically for copy-ctors llvm-svn: 333381
* Mark the template deduction tests as UNSUPPORTED on clang 5, because it ↵Marshall Clow2018-05-282-1/+6
| | | | | | deduces the wrong type. llvm-svn: 333376
* Fix array deduction guide test breakageJF Bastien2018-05-251-0/+3
| | | | | | No matching constructor llvm-svn: 333315
* Missed the tests for the deduction guides for prority_queueMarshall Clow2018-05-222-0/+181
| | | | llvm-svn: 332931
* Deduction guides for the container adaptors - queue, stack, and priority_queueMarshall Clow2018-05-224-0/+279
| | | | llvm-svn: 332927
* Implement deduction guides for vectorMarshall Clow2018-05-212-0/+156
| | | | llvm-svn: 332901
* Deduction guides for listMarshall Clow2018-05-202-0/+145
| | | | llvm-svn: 332818
* Implement deduction guides for forward_listMarshall Clow2018-05-192-0/+145
| | | | llvm-svn: 332811
* Remove expression '1L + INT_MAX', because it overflows on machines where ↵Marshall Clow2018-05-191-2/+2
| | | | | | int/long are the same size llvm-svn: 332797
* Implement deduction guides for <deque>Marshall Clow2018-05-182-0/+140
| | | | llvm-svn: 332785
* Disable 'missing-braces' warningMarshall Clow2018-05-182-0/+9
| | | | llvm-svn: 332779
* Implement deduction guides for <array>; Reviewed as ↵Marshall Clow2018-05-182-0/+90
| | | | | | https://reviews.llvm.org/D46964 llvm-svn: 332768
* [libcxx] [test] Fix whitespace, NFC.Stephan T. Lavavej2018-04-122-27/+27
| | | | | | test/std almost always uses spaces; now it is entirely tab-free. llvm-svn: 329978
* [test] Fix Container::insert(value_type const&) testsEric Fiselier2018-04-0810-405/+293
| | | | | | | | | | | Patch from Joe Loser. Several unit tests meaning to test the behavior of lvalue insertion incorrectly pass rvalues. Fixes bug PR # 27394 Reviewed as https://reviews.llvm.org/D44411 llvm-svn: 329541
* [libcxx] [test] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-123-8/+8
| | | | 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
* 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 -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-0714-4/+500
| | | | | | | | | | | | | | | | | | | 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
* 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
* 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
* Implement LWG2783: stack::emplace() and queue::emplace() should return ↵Marshall Clow2018-01-242-21/+59
| | | | | | decltype(auto) llvm-svn: 323385
* Mark LWG2824 as complete. We already did it, but I added a test to be sureMarshall Clow2018-01-031-0/+41
| | | | llvm-svn: 321689
* Fix copy/paste bug in test where we were putting a '3' into a vector<bool>. NFC.Marshall Clow2017-11-261-2/+2
| | | | llvm-svn: 318990
* Add some tests for operations on const associative containers. Part of LWG#2542Marshall Clow2017-11-226-9/+32
| | | | llvm-svn: 318818
* Replace assert(true) in tests with actual asserts. Reviewed as ↵Billy Robert O'Neal III2017-11-211-2/+2
| | | | | | | | | | | | | | https://reviews.llvm.org/D40324 In a17cd7c641c34b6c4bd4845a4d4fb590cb6c238c Marshall added assert(true) to the vector<bool>::size tests, which break on C1XX: D:\Contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(62): error C2220: warning treated as error - no 'object' file generated d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(33) : warning C6326: Potential comparison of a constant with another constant. d:\contest\gl0qojfu.5pe\src\qa\vc\libs\libcxx\upstream\test\std\containers\sequences\vector.bool\size.pass.cpp(52) : warning C6326: Potential comparison of a constant with another constant. The corresponding test for vector::size asserts assert(c.size() == 3);, so I changed it to do that here. llvm-svn: 318812
* Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed ↵Billy Robert O'Neal III2017-11-2133-38/+38
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* Tolerate even more [[nodiscard]] in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-152-6/+6
| | | | | | https://reviews.llvm.org/D39080 llvm-svn: 318277
* Tolerate [[nodiscard]] annotations in the STL. Reviewed as ↵Billy Robert O'Neal III2017-11-1540-50/+74
| | | | | | https://reviews.llvm.org/D39033 llvm-svn: 318276
* First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow2017-11-1517-0/+476
| | | | | | 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only llvm-svn: 318269
* Still more missing tests - this time for the unordered containersMarshall Clow2017-11-158-0/+432
| | | | llvm-svn: 318268
* More missing tests - array<>::size() and array<>::max_size()Marshall Clow2017-11-152-0/+72
| | | | llvm-svn: 318256
* Added tests for xxx.size() and xxx.empty() for all the sequence containersMarshall Clow2017-11-159-0/+478
| | | | llvm-svn: 318244
* [libc++] Fix PR34898 - vector iterator constructors and assign method ↵Eric Fiselier2017-10-177-66/+666
| | | | | | | | | | | | | | | | | | | | | | | perform push_back instead of emplace_back. Summary: The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy. This patch addresses the issue by correctly using `emplace_back` in C++11 and newer. There are also some bugs in our `insert` implementation, but those will be handled separately. @mclow.lists We should probably merge this into 5.1, agreed? Reviewers: mclow.lists, dlj, EricWF Reviewed By: mclow.lists, EricWF Subscribers: cfe-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D38757 llvm-svn: 315994
* [test] Allow other implementations to strengthen noexcept on deque's move ↵Casey Carter2017-09-301-1/+1
| | | | | | constructor llvm-svn: 314608
* [test] forwardlist.cons/move_noexcept.pass.cppCasey Carter2017-09-281-1/+1
| | | | | | * Don't forbid non-libc++ implementations from strengthening noexcept on forward_list's move constructor. llvm-svn: 314459
* [libcxx] [test] Update for C++17 feature removals.Stephan T. Lavavej2017-08-242-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/std/containers/Emplaceable.h test/std/containers/NotConstructible.h test/support/counting_predicates.hpp Replace unary_function/binary_function inheritance with typedefs. test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp test/std/utilities/function.objects/func.require/binary_function.pass.cpp test/std/utilities/function.objects/func.require/unary_function.pass.cpp Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function. test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support. test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp This test doesn't need to be skipped in C++17 mode. Only the construction of std::function from an allocator needs to be skipped in C++17 mode. test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp When testing these reference_wrapper features, unary_function inheritance is totally irrelevant. test/std/utilities/function.objects/refwrap/weak_result.pass.cpp Define and use my_unary_function/my_binary_function to test the weak result type machinery (which is still present in C++17, although deprecated). test/support/msvc_stdlib_force_include.hpp Now we can test C++17 strictly, without enabling removed features. Fixes D36503. llvm-svn: 311705
* [libcxx] [test] Change comments to say C++ instead of c++. NFC.Stephan T. Lavavej2017-07-295-5/+5
| | | | | | | | This makes them consistent (many comments already used uppercase). The special REQUIRES, UNSUPPORTED, and XFAIL comments are excluded from this change. llvm-svn: 309468
* [libcxx] [test] Make files consistently end with newlines, NFC.Stephan T. Lavavej2017-07-291-1/+1
| | | | llvm-svn: 309465
* [libcxx] [test] Untabify, NFC.Stephan T. Lavavej2017-07-2932-114/+114
| | | | llvm-svn: 309464
OpenPOWER on IntegriCloud