summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/sequences
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix test failures after r334053.Eric Fiselier2018-06-061-1/+3
| | | | llvm-svn: 334056
* Fix PR37694 - std::vector doesn't correctly move construct allocators.Eric Fiselier2018-06-052-0/+64
| | | | | | | | | | | | | | | | | | | 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-291-1/+1
| | | | | | | 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
* Fix array deduction guide test breakageJF Bastien2018-05-251-0/+3
| | | | | | No matching constructor llvm-svn: 333315
* 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] Strip trailing whitespace, NFC.Stephan T. Lavavej2018-02-121-4/+4
| | | | llvm-svn: 324959
* 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
* 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
* 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-211-2/+2
| | | | | | as https://reviews.llvm.org/D40065 llvm-svn: 318804
* First part of P0600 - '[[nodiscard] in the standard library'. Mark the ↵Marshall Clow2017-11-156-0/+168
| | | | | | '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
* 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] 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] Untabify, NFC.Stephan T. Lavavej2017-07-2911-46/+46
| | | | llvm-svn: 309464
* [array.tuple]/1 says that instantiating tuple_element<N, array<T, M>> is ↵Marshall Clow2017-06-121-0/+35
| | | | | | ill-formed if N >= M. We didn't do that. Add a static_assert to cause a failure, and a test that checks that we failed llvm-svn: 305191
* [libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant ↵Stephan T. Lavavej2017-05-051-2/+2
| | | | | | | | | | with another constant". The expressions `1 == 1` and `true` have the same type, value category, and value. Fixes D32924. llvm-svn: 302322
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-05-041-1/+1
| | | | llvm-svn: 302105
* Sigh. Once again forgot about the 'no exceptions' bots.Marshall Clow2017-04-172-0/+8
| | | | llvm-svn: 300451
* Mark LWG#2853 as complete. No code changes required, but added a couple of ↵Marshall Clow2017-04-172-0/+48
| | | | | | extra tests llvm-svn: 300449
* Cleanup one more <forward_list> testEric Fiselier2017-04-162-35/+5
| | | | llvm-svn: 300417
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>Eric Fiselier2017-04-1611-45/+21
| | | | llvm-svn: 300415
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>Eric Fiselier2017-04-169-36/+18
| | | | llvm-svn: 300414
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in dequeEric Fiselier2017-04-1610-42/+20
| | | | llvm-svn: 300413
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>Eric Fiselier2017-04-161-1/+3
| | | | llvm-svn: 300412
* Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.Eric Fiselier2017-04-1619-81/+43
| | | | | | | | | | | | | This patch cleans up all usages of the following feature test macros inside <vector> and its tests: * _LIBCPP_HAS_NO_RVALUE_REFERENCES * _LIBCPP_HAS_NO_VARIADICS * _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS Where needed the above guards were replaced with _LIBCPP_CXX03_LANG. llvm-svn: 300410
* [libcxx] Improve code generation for vector::clear().Bruce Mitchener2017-03-231-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: By manipulating a local variable in the loop, when the loop can be optimized away (due to no non-trivial destructors), this lets it be fully optimized away and we modify the __end_ separately. This results in a substantial improvement in the generated code. Prior to this change, this would be generated (on x86_64): movq (%rdi), %rdx movq 8(%rdi), %rcx cmpq %rdx, %rcx je LBB2_2 leaq -12(%rcx), %rax subq %rdx, %rax movabsq $-6148914691236517205, %rdx ## imm = 0xAAAAAAAAAAAAAAAB mulq %rdx shrq $3, %rdx notq %rdx leaq (%rdx,%rdx,2), %rax leaq (%rcx,%rax,4), %rax movq %rax, 8(%rdi) And after: movq (%rdi), %rax movq %rax, 8(%rdi) This brings this in line with what other implementations do. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25241 llvm-svn: 298601
* Implement P0599: 'noexcept for hash functions'. Fix a couple of hash ↵Marshall Clow2017-03-231-1/+3
| | | | | | functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234 llvm-svn: 298573
* Fix sign-compare warning in test; Oddly this only appears on OS XEric Fiselier2017-03-031-7/+5
| | | | llvm-svn: 296851
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-171-1/+1
| | | | llvm-svn: 295434
* Stop using random_shuffle in the libc++ test suite. It's going to be removed ↵Marshall Clow2017-02-072-2/+8
| | | | | | in c++17. Use shuffle() instead. No change to libc++, just the tests. llvm-svn: 294328
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.Stephan T. Lavavej2017-02-052-2/+0
| | | | | | | | These typedefs were completely unused. Fixes D29136. llvm-svn: 294155
* [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.Stephan T. Lavavej2017-02-0522-51/+110
| | | | | | | | | | | | | | | | | Guard typedefs and static_asserts with _LIBCPP_VERSION. test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp Additionally deal with conditional compilation. test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp Additionally deal with typedefs used by other typedefs. Fixes D29135. llvm-svn: 294154
OpenPOWER on IntegriCloud