summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix bug 33389 - __is_transparent check requires too muchMarshall Clow2017-06-1310-10/+60
| | | | llvm-svn: 305292
* [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
* Fix tests for extended noexcept in the container adaptors testsEric Fiselier2017-04-196-9/+12
| | | | llvm-svn: 300652
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and ↵Eric Fiselier2017-04-1823-149/+51
| | | | | | | | std::unordered_multimap This completes the cleanup of the containers, at least within the tests. llvm-svn: 300620
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and ↵Eric Fiselier2017-04-1826-196/+58
| | | | | | std::unordered_multiset llvm-svn: 300619
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.Eric Fiselier2017-04-1820-58/+44
| | | | llvm-svn: 300604
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.Eric Fiselier2017-04-1810-30/+22
| | | | llvm-svn: 300602
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimapEric Fiselier2017-04-1821-88/+42
| | | | llvm-svn: 300600
* Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multisetEric Fiselier2017-04-1824-88/+48
| | | | llvm-svn: 300595
* 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
* Fix more -Wshadow warnings introduced by recent Clang changeEric Fiselier2017-04-045-6/+0
| | | | llvm-svn: 299411
* [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
* Fix test failures due to bad test hasherEric Fiselier2017-03-0118-0/+24
| | | | llvm-svn: 296568
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-176-8/+8
| | | | 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-0518-57/+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-0567-147/+305
| | | | | | | | | | | | | | | | | 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
* Change the return type of emplace_[front|back] back to void when building ↵Marshall Clow2017-01-249-9/+165
| | | | | | with C++14 or before. Resolves PR31680. llvm-svn: 292990
* Implement P0513R0 - "Poisoning the Hash"Eric Fiselier2017-01-211-0/+28
| | | | | | | | | | | | | | | | | | | | | Summary: Exactly what the title says. This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it. See http://wg21.link/P0513R0 for more info. If there are no comments in the next couple of days I'll commit this Reviewers: mclow.lists, K-ballo, EricWF Reviewed By: EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28938 llvm-svn: 292684
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-1812-13/+13
| | | | | | No functional change, no code review. llvm-svn: 292434
* [libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.Stephan T. Lavavej2017-01-181-2/+2
| | | | | | | | | | | | | | | | | | MSVC has compiler warnings C4127 "conditional expression is constant" (enabled by /W4) and C6326 "Potential comparison of a constant with another constant" (enabled by /analyze). They're potentially useful, although they're slightly annoying to library devs who know what they're doing. In the latest version of the compiler, C4127 is suppressed when the compiler sees simple tests like "if (name_of_thing)", so extracting comparison expressions into named constants is a workaround. At the same time, using std::integral_constant avoids C6326, which doesn't look at template arguments. test/std/containers/sequences/vector.bool/emplace.pass.cpp Replace 1 == 1 with true, which is the same as far as the library is concerned. Fixes D28837. llvm-svn: 292432
* Implement the missing constexpr stuff in <array>. Fixes PR#31645.Marshall Clow2017-01-163-3/+53
| | | | llvm-svn: 292091
* [libcxx] [test] Strip trailing whitespace. NFC, no code review.Stephan T. Lavavej2017-01-071-2/+2
| | | | llvm-svn: 291322
* Implement the last bit of P0031: 'A Proposal to Add Constexpr Modifiers to ↵Marshall Clow2017-01-042-0/+47
| | | | | | reverse_iterator, move_iterator, array and Range Access' for C++17 llvm-svn: 290976
* Fix debug mode for vector/list and cleanup testsEric Fiselier2016-12-2814-502/+16
| | | | llvm-svn: 290657
* Fix yet another missed -Wunused warning. Hopefully this is the last oneEric Fiselier2016-12-241-7/+8
| | | | llvm-svn: 290476
* fix warnings only produced by apple-clangEric Fiselier2016-12-245-33/+20
| | | | llvm-svn: 290474
* Fix unused parameters and variablesEric Fiselier2016-12-237-48/+27
| | | | llvm-svn: 290459
* Fix PR31378 - std::list::remove should not require a default constructible ↵Eric Fiselier2016-12-141-33/+47
| | | | | | | | | | | | allocator. In list::remove we collect the nodes we're removing in a seperate list instance. However we construct this list using the default constructor which default constructs the allocator. However allocators are not required to be default constructible. This patch fixes the construction of the second list. llvm-svn: 289735
* [libcxx] [test] Fix MSVC x64 truncation warnings with 32-bit allocator ↵Stephan T. Lavavej2016-12-143-3/+3
| | | | | | | | | | | | | | | | size_type/difference_type. test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp Iterate with C::size_type because that's what operator[] takes. test/std/containers/sequences/vector/contiguous.pass.cpp test/std/strings/basic.string/string.require/contiguous.pass.cpp Add static_cast<typename C::difference_type> because that's what the iterator's operator+ takes. Fixes D27777. llvm-svn: 289734
* [libcxx] [test] Fix an improper assumption about Null Forward Iterators.Stephan T. Lavavej2016-12-121-4/+0
| | | | | | | | Value-initialized iterators still can't be compared to those with parents. Fixes D26626. llvm-svn: 289462
* Enable the -Wsign-compare warning to better support MSVCEric Fiselier2016-12-114-16/+25
| | | | llvm-svn: 289363
* Fix copy/paste errors introduced in r289358Eric Fiselier2016-12-112-16/+16
| | | | llvm-svn: 289359
* Fix undefined behavior in container swap tests.Eric Fiselier2016-12-1117-183/+180
| | | | | | | | | | | | These swap tests were swapping non-POCS non-equal allocators which is undefined behavior. This patch changes the tests to use allocators which compare equal. In order to test that the allocators were not swapped I added an "id" field to test_allocator which does not participate in equality but does propagate across copies/swaps. This patch is based off of D26623 which was submitted by STL. llvm-svn: 289358
* Fix missing const on set::count. Patch from Andrey KhalyavinEric Fiselier2016-12-091-9/+11
| | | | llvm-svn: 289204
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-082-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | loss of data", part 6/7. test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp (Affects 64-bit architectures.) Include <cstddef> so we can take/return std::ptrdiff_t (instead of int) in random_shuffle()'s RNG. (C++14 D.12 [depr.alg.random.shuffle]/2 says that difference_type is used, and we're shuffling a plain array.) test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort.pass.cpp (Affects 64-bit architectures.) Include <iterator> because we're already using iterator_traits. Then, store the result of subtracting two RanIts as difference_type instead of long (which truncates on LLP64 architectures like MSVC x64). test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_flist.pass.cpp test/std/containers/sequences/forwardlist/forwardlist.ops/splice_after_one.pass.cpp (Affects 64-bit architectures.) Include <cstddef> so we can store the result of subtracting two pointers as std::ptrdiff_t (instead of int). test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp (Affects 32-bit architectures.) Sometimes, size_t is too small. That's the case here, where tellg() returns pos_type (N4606 27.7.2.3 [istream.unformatted]/39). Implementations can have 64-bit pos_type (to handle large files) even when they have 32-bit size_t. Fixes D27543. llvm-svn: 289110
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-084-32/+32
| | | | | | | | | | loss of data", part 3/7. Add static_cast<short> when constructing pair<Whatever, short> from (Something, int). Fixes D27540. llvm-svn: 289107
* [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' ↵Stephan T. Lavavej2016-12-064-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | to 'int' [or 'unsigned int'], possible loss of data", part 3/4. test/std/containers/sequences/vector.bool/copy.pass.cpp test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp test/std/containers/sequences/vector/vector.cons/copy.pass.cpp test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp Change "unsigned s = x.size();" to "typename C::size_type s = x.size();" because that's what it returns. test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp Include <cstddef>, then change "unsigned n = T::length(s);" to "std::size_t n = T::length(s);" because that's what char_traits returns. test/std/strings/basic.string/string.cons/substr.pass.cpp Change unsigned to typename S::size_type because that's what str.size() returns. test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp This was needlessly truncating std::size_t to unsigned. It's being used to compare and initialize std::size_t. llvm-svn: 288753
* [libcxx] [test] D27266: Remove spurious semicolons.Stephan T. Lavavej2016-12-061-1/+1
| | | | llvm-svn: 288750
OpenPOWER on IntegriCloud