Skip to content

Commit 12e1ae2

Browse files
authored
Merge pull request #43 from mclow/test-failures.1
Address most of the test failures in the lib test suite
2 parents dc374cc + 13b22de commit 12e1ae2

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

libcxx/include/__algorithm/swap_ranges.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
#include <__algorithm/iterator_operations.h>
1313
#include <__config>
14+
#include <__cstddef/byte.h>
15+
#include <__cstddef/size_t.h>
16+
#include <__iterator/iterator_traits.h>
17+
#include <__type_traits/is_same.h>
18+
#include <__type_traits/is_trivially_relocatable.h>
1419
#include <__utility/move.h>
1520
#include <__utility/pair.h>
1621

libcxx/include/__memory/uninitialized_algorithms.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <__algorithm/unwrap_iter.h>
1616
#include <__algorithm/unwrap_range.h>
1717
#include <__config>
18+
#include <__functional/operations.h>
1819
#include <__iterator/iterator_traits.h>
1920
#include <__iterator/reverse_iterator.h>
2021
#include <__memory/addressof.h>
@@ -27,6 +28,7 @@
2728
#include <__type_traits/extent.h>
2829
#include <__type_traits/is_array.h>
2930
#include <__type_traits/is_constant_evaluated.h>
31+
#include <__type_traits/is_nothrow_constructible.h>
3032
#include <__type_traits/is_trivially_assignable.h>
3133
#include <__type_traits/is_trivially_constructible.h>
3234
#include <__type_traits/is_trivially_relocatable.h>
@@ -37,10 +39,9 @@
3739
#include <__utility/exception_guard.h>
3840
#include <__utility/move.h>
3941
#include <__utility/pair.h>
42+
#include <__utility/unreachable.h>
4043
#include <new>
4144

42-
#include <cassert>
43-
4445
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
4546
# pragma GCC system_header
4647
#endif

libcxx/include/vector

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ vector<_Tp, _Allocator>::erase(const_iterator __position) {
15821582
// destroy the element at __p
15831583
__alloc_traits::destroy(__alloc(), std::__to_address(__p));
15841584
// move the rest down
1585-
(void) relocate(__p + 1, this->__end_, __p);
1585+
(void) relocate(std::__to_address(__p + 1), std::__to_address(this->__end_), std::__to_address(__p));
15861586
// update the end
15871587
this->__end_--;
15881588
__annotate_shrink(__old_size);
@@ -1647,7 +1647,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
16471647
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
16481648
// Make space by trivially relocating everything
16491649
_ConstructTransaction __tx(*this, 1);
1650-
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
1650+
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
16511651
// construct the new element (not assign!)
16521652
const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
16531653
if (std::__is_pointer_in_range(std::__to_address(__p), std::__to_address(__end_), std::addressof(__x)))
@@ -1687,7 +1687,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) {
16871687
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
16881688
// Make space by trivially relocating everything
16891689
_ConstructTransaction __tx(*this, 1);
1690-
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
1690+
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
16911691
// construct the new element (not assign!)
16921692
__alloc_traits::construct(this->__alloc(), std::__to_address(__p), std::forward<value_type>(__x));
16931693
++__tx.__pos_;
@@ -1722,7 +1722,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) {
17221722
if constexpr (is_trivially_relocatable_v<_Tp> || is_nothrow_move_constructible_v<_Tp>) {
17231723
// Make space by trivially relocating everything
17241724
_ConstructTransaction __tx(*this, 1);
1725-
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), __p + 1);
1725+
(void) relocate(std::__to_address(__p), std::__to_address(this->__end_), std::__to_address(__p + 1));
17261726
// construct the new element
17271727
__alloc_traits::construct(this->__alloc(), std::__to_address(__p), std::forward<_Args>(__args)...);
17281728
++__tx.__pos_;

0 commit comments

Comments
 (0)