From 147f6ed39f66a3812a27d0ecd154c8efc1918688 Mon Sep 17 00:00:00 2001
From: Patrick Palka
Date: Tue, 4 Oct 2022 09:45:15 -0400
Subject: libstdc++: Implement ranges::join_with_view from P2441R2
libstdc++-v3/ChangeLog:
* include/std/ranges: Include for C++23.
(__detail::__compatible_joinable_ranges): Define.
(__detail::__bidirectional_common): Define.
(join_with_view): Define.
(join_with_view::_Iterator): Define.
(join_with_view::_Sentinel): Define.
(views::__detail::__can_join_with_view): Define.
(views::_JoinWith, views::join_with): Define.
* testsuite/std/ranges/adaptors/join_with/1.cc: New test.
---
libstdc++-v3/include/std/ranges | 458 +++++++++++++++++++++
.../testsuite/std/ranges/adaptors/join_with/1.cc | 97 +++++
2 files changed, 555 insertions(+)
create mode 100644 libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index c2eacde..d0d6ce6 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -44,6 +44,9 @@
#include
#include
#include
+#if __cplusplus > 202002L
+#include
+#endif
#include
#include
@@ -6873,6 +6876,461 @@ namespace views::__adaptor
inline constexpr _ChunkBy chunk_by;
}
+
+ namespace __detail
+ {
+ template
+ concept __compatible_joinable_ranges
+ = common_with, range_value_t<_Pattern>>
+ && common_reference_with,
+ range_reference_t<_Pattern>>
+ && common_reference_with,
+ range_rvalue_reference_t<_Pattern>>;
+
+ template
+ concept __bidirectional_common = bidirectional_range<_Range> && common_range<_Range>;
+ }
+
+ template
+ requires view<_Vp> && view<_Pattern>
+ && input_range>
+ && __detail::__compatible_joinable_ranges, _Pattern>
+ class join_with_view : public view_interface>
+ {
+ using _InnerRange = range_reference_t<_Vp>;
+
+ _Vp _M_base = _Vp();
+ __detail::__non_propagating_cache> _M_inner;
+ _Pattern _M_pattern = _Pattern();
+
+ template using _Base = __detail::__maybe_const_t<_Const, _Vp>;
+ template using _InnerBase = range_reference_t<_Base<_Const>>;
+ template using _PatternBase = __detail::__maybe_const_t<_Const, _Pattern>;
+
+ template using _OuterIter = iterator_t<_Base<_Const>>;
+ template using _InnerIter = iterator_t<_InnerBase<_Const>>;
+ template using _PatternIter = iterator_t<_PatternBase<_Const>>;
+
+ template
+ static constexpr bool _S_ref_is_glvalue = is_reference_v<_InnerBase<_Const>>;
+
+ template
+ struct __iter_cat
+ { };
+
+ template
+ requires _S_ref_is_glvalue<_Const>
+ && forward_range<_Base<_Const>>
+ && forward_range<_InnerBase<_Const>>
+ struct __iter_cat<_Const>
+ {
+ private:
+ static auto
+ _S_iter_cat()
+ {
+ using _OuterIter = join_with_view::_OuterIter<_Const>;
+ using _InnerIter = join_with_view::_InnerIter<_Const>;
+ using _PatternIter = join_with_view::_PatternIter<_Const>;
+ using _OuterCat = typename iterator_traits<_OuterIter>::iterator_category;
+ using _InnerCat = typename iterator_traits<_InnerIter>::iterator_category;
+ using _PatternCat = typename iterator_traits<_PatternIter>::iterator_category;
+ if constexpr (!is_lvalue_reference_v,
+ iter_reference_t<_PatternIter>>>)
+ return input_iterator_tag{};
+ else if constexpr (derived_from<_OuterCat, bidirectional_iterator_tag>
+ && derived_from<_InnerCat, bidirectional_iterator_tag>
+ && derived_from<_PatternCat, bidirectional_iterator_tag>
+ && common_range<_InnerBase<_Const>>
+ && common_range<_PatternBase<_Const>>)
+ return bidirectional_iterator_tag{};
+ else if constexpr (derived_from<_OuterCat, forward_iterator_tag>
+ && derived_from<_InnerCat, forward_iterator_tag>
+ && derived_from<_PatternCat, forward_iterator_tag>)
+ return forward_iterator_tag{};
+ else
+ return input_iterator_tag{};
+ }
+ public:
+ using iterator_category = decltype(_S_iter_cat());
+ };
+
+ template struct _Iterator;
+ template struct _Sentinel;
+
+ public:
+ join_with_view() requires (default_initializable<_Vp>
+ && default_initializable<_Pattern>)
+ = default;
+
+ constexpr
+ join_with_view(_Vp __base, _Pattern __pattern)
+ : _M_base(std::move(__base)), _M_pattern(std::move(__pattern))
+ { }
+
+ template
+ requires constructible_from<_Vp, views::all_t<_Range>>
+ && constructible_from<_Pattern, single_view>>
+ constexpr
+ join_with_view(_Range&& __r, range_value_t<_InnerRange> __e)
+ : _M_base(views::all(std::forward<_Range>(__r))),
+ _M_pattern(views::single(std::move(__e)))
+ { }
+
+ constexpr _Vp
+ base() const& requires copy_constructible<_Vp>
+ { return _M_base; }
+
+ constexpr _Vp
+ base() &&
+ { return std::move(_M_base); }
+
+ constexpr auto
+ begin()
+ {
+ constexpr bool __use_const = is_reference_v<_InnerRange>
+ && __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>;
+ return _Iterator<__use_const>{*this, ranges::begin(_M_base)};
+ }
+
+ constexpr auto
+ begin() const
+ requires input_range
+ && forward_range
+ && is_reference_v>
+ { return _Iterator{*this, ranges::begin(_M_base)}; }
+
+ constexpr auto
+ end()
+ {
+ constexpr bool __use_const
+ = __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>;
+ if constexpr (is_reference_v<_InnerRange>
+ && forward_range<_Vp> && common_range<_Vp>
+ && forward_range<_InnerRange> && common_range<_InnerRange>)
+ return _Iterator<__use_const>{*this, ranges::end(_M_base)};
+ else
+ return _Sentinel<__use_const>{*this};
+ }
+
+ constexpr auto
+ end() const
+ requires input_range
+ && forward_range
+ && is_reference_v>
+ {
+ using _InnerConstRange = range_reference_t;
+ if constexpr (forward_range
+ && forward_range<_InnerConstRange>
+ && common_range
+ && common_range<_InnerConstRange>)
+ return _Iterator{*this, ranges::end(_M_base)};
+ else
+ return _Sentinel{*this};
+ }
+ };
+
+ template
+ join_with_view(_Range&&, _Pattern&&)
+ -> join_with_view, views::all_t<_Pattern>>;
+
+ template
+ join_with_view(_Range&&, range_value_t>)
+ -> join_with_view,
+ single_view>>>;
+
+ template
+ requires view<_Vp> && view<_Pattern>
+ && input_range>
+ && __detail::__compatible_joinable_ranges, _Pattern>
+ template
+ class join_with_view<_Vp, _Pattern>::_Iterator : public __iter_cat<_Const>
+ {
+ using _Parent = __detail::__maybe_const_t<_Const, join_with_view>;
+ using _Base = join_with_view::_Base<_Const>;
+ using _InnerBase = join_with_view::_InnerBase<_Const>;
+ using _PatternBase = join_with_view::_PatternBase<_Const>;
+
+ using _OuterIter = join_with_view::_OuterIter<_Const>;
+ using _InnerIter = join_with_view::_InnerIter<_Const>;
+ using _PatternIter = join_with_view::_PatternIter<_Const>;
+
+ static constexpr bool _S_ref_is_glvalue = join_with_view::_S_ref_is_glvalue<_Const>;
+
+ _Parent* _M_parent = nullptr;
+ _OuterIter _M_outer_it = _OuterIter();
+ variant<_PatternIter, _InnerIter> _M_inner_it;
+
+ constexpr
+ _Iterator(_Parent& __parent, iterator_t<_Base> __outer)
+ : _M_parent(std::__addressof(__parent)), _M_outer_it(std::move(__outer))
+ {
+ if (_M_outer_it != ranges::end(_M_parent->_M_base))
+ {
+ auto&& __inner = _M_update_inner(_M_outer_it);
+ _M_inner_it.template emplace<1>(ranges::begin(__inner));
+ _M_satisfy();
+ }
+ }
+
+ constexpr auto&&
+ _M_update_inner(const _OuterIter& __x)
+ {
+ if constexpr (_S_ref_is_glvalue)
+ return *__x;
+ else
+ return _M_parent->_M_inner._M_emplace_deref(__x);
+ }
+
+ constexpr auto&&
+ _M_get_inner(const _OuterIter& __x)
+ {
+ if constexpr (_S_ref_is_glvalue)
+ return *__x;
+ else
+ return *_M_parent->_M_inner;
+ }
+
+ constexpr void
+ _M_satisfy()
+ {
+ while (true)
+ {
+ if (_M_inner_it.index() == 0)
+ {
+ if (std::get<0>(_M_inner_it) != ranges::end(_M_parent->_M_pattern))
+ break;
+
+ auto&& __inner = _M_update_inner(_M_outer_it);
+ _M_inner_it.template emplace<1>(ranges::begin(__inner));
+ }
+ else
+ {
+ auto&& __inner = _M_get_inner(_M_outer_it);
+ if (std::get<1>(_M_inner_it) != ranges::end(__inner))
+ break;
+
+ if (++_M_outer_it == ranges::end(_M_parent->_M_base))
+ {
+ if constexpr (_S_ref_is_glvalue)
+ _M_inner_it.template emplace<0>();
+ break;
+ }
+
+ _M_inner_it.template emplace<0>(ranges::begin(_M_parent->_M_pattern));
+ }
+ }
+ }
+
+ static auto
+ _S_iter_concept()
+ {
+ if constexpr (_S_ref_is_glvalue
+ && bidirectional_range<_Base>
+ && __detail::__bidirectional_common<_InnerBase>
+ && __detail::__bidirectional_common<_PatternBase>)
+ return bidirectional_iterator_tag{};
+ else if constexpr (_S_ref_is_glvalue
+ && forward_range<_Base>
+ && forward_range<_InnerBase>)
+ return forward_iterator_tag{};
+ else
+ return input_iterator_tag{};
+ }
+
+ friend join_with_view;
+
+ public:
+ using iterator_concept = decltype(_S_iter_concept());
+ // iterator_category defined in join_with_view::__iter_cat
+ using value_type = common_type_t,
+ iter_value_t<_PatternIter>>;
+ using difference_type = common_type_t,
+ iter_difference_t<_InnerIter>,
+ iter_difference_t<_PatternIter>>;
+
+ _Iterator() requires default_initializable<_OuterIter> = default;
+
+ constexpr
+ _Iterator(_Iterator __i)
+ requires _Const
+ && convertible_to, _OuterIter>
+ && convertible_to, _InnerIter>
+ && convertible_to, _PatternIter>
+ : _M_parent(__i._M_parent),
+ _M_outer_it(std::move(__i._M_outer_it))
+ {
+ if (__i._M_inner_it.index() == 0)
+ _M_inner_it.template emplace<0>(std::get<0>(std::move(__i._M_inner_it)));
+ else
+ _M_inner_it.template emplace<1>(std::get<1>(std::move(__i._M_inner_it)));
+ }
+
+ constexpr decltype(auto)
+ operator*() const
+ {
+ using reference = common_reference_t,
+ iter_reference_t<_PatternIter>>;
+ return std::visit([](auto& __it) -> reference { return *__it; }, _M_inner_it);
+ }
+
+ constexpr _Iterator&
+ operator++()
+ {
+ std::visit([](auto& __it){ ++__it; }, _M_inner_it);
+ _M_satisfy();
+ return *this;
+ }
+
+ constexpr void
+ operator++(int)
+ { ++*this; }
+
+ constexpr _Iterator
+ operator++(int)
+ requires _S_ref_is_glvalue
+ && forward_iterator<_OuterIter> && forward_iterator<_InnerIter>
+ {
+ _Iterator __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ constexpr _Iterator&
+ operator--()
+ requires _S_ref_is_glvalue
+ && bidirectional_range<_Base>
+ && __detail::__bidirectional_common<_InnerBase>
+ && __detail::__bidirectional_common<_PatternBase>
+ {
+ if (_M_outer_it == ranges::end(_M_parent->_M_base))
+ {
+ auto&& __inner = *--_M_outer_it;
+ _M_inner_it.template emplace<1>(ranges::end(__inner));
+ }
+
+ while (true)
+ {
+ if (_M_inner_it.index() == 0)
+ {
+ auto& __it = std::get<0>(_M_inner_it);
+ if (__it == ranges::begin(_M_parent->_M_pattern))
+ {
+ auto&& __inner = *--_M_outer_it;
+ _M_inner_it.template emplace<1>(ranges::end(__inner));
+ }
+ else
+ break;
+ }
+ else
+ {
+ auto& __it = std::get<1>(_M_inner_it);
+ auto&& __inner = *_M_outer_it;
+ if (__it == ranges::begin(__inner))
+ _M_inner_it.template emplace<0>(ranges::end(_M_parent->_M_pattern));
+ else
+ break;
+ }
+ }
+
+ std::visit([](auto& __it){ --__it; }, _M_inner_it);
+ return *this;
+ }
+
+ constexpr _Iterator
+ operator--(int)
+ requires _S_ref_is_glvalue && bidirectional_range<_Base>
+ && __detail::__bidirectional_common<_InnerBase>
+ && __detail::__bidirectional_common<_PatternBase>
+ {
+ _Iterator __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ friend constexpr bool
+ operator==(const _Iterator& __x, const _Iterator& __y)
+ requires _S_ref_is_glvalue
+ && equality_comparable<_OuterIter> && equality_comparable<_InnerIter>
+ { return __x._M_outer_it == __y._M_outer_it && __x._M_inner_it ==__y._M_inner_it; }
+
+ friend constexpr decltype(auto)
+ iter_move(const _Iterator& __x)
+ {
+ using __rval_ref = common_reference_t,
+ iter_rvalue_reference_t<_PatternIter>>;
+ return std::visit<__rval_ref>(ranges::iter_move, __x._M_inner_it);
+ }
+
+ friend constexpr void
+ iter_swap(const _Iterator& __x, const _Iterator& __y)
+ requires indirectly_swappable<_InnerIter, _PatternIter>
+ { std::visit(ranges::iter_swap, __x._M_inner_it, __y._M_inner_it); }
+ };
+
+ template
+ requires view<_Vp> && view<_Pattern>
+ && input_range>
+ && __detail::__compatible_joinable_ranges, _Pattern>
+ template
+ class join_with_view<_Vp, _Pattern>::_Sentinel
+ {
+ using _Parent = __detail::__maybe_const_t<_Const, join_with_view>;
+ using _Base = join_with_view::_Base<_Const>;
+
+ sentinel_t<_Base> _M_end = sentinel_t<_Base>();
+
+ constexpr explicit
+ _Sentinel(_Parent& __parent)
+ : _M_end(ranges::end(__parent._M_base))
+ { }
+
+ friend join_with_view;
+
+ public:
+ _Sentinel() = default;
+
+ constexpr
+ _Sentinel(_Sentinel __s)
+ requires _Const && convertible_to, sentinel_t<_Base>>
+ : _M_end(std::move(__s._M_end))
+ { }
+
+ template
+ requires sentinel_for,
+ iterator_t<__detail::__maybe_const_t<_OtherConst, _Vp>>>
+ friend constexpr bool
+ operator==(const _Iterator<_OtherConst>& __x, const _Sentinel& __y)
+ { return __x._M_outer_it == __y._M_end; }
+ };
+
+ namespace views
+ {
+ namespace __detail
+ {
+ template
+ concept __can_join_with_view
+ = requires { join_with_view(std::declval<_Range>(), std::declval<_Pattern>()); };
+ } // namespace __detail
+
+ struct _JoinWith : __adaptor::_RangeAdaptor<_JoinWith>
+ {
+ template
+ requires __detail::__can_join_with_view<_Range, _Pattern>
+ constexpr auto
+ operator() [[nodiscard]] (_Range&& __r, _Pattern&& __f) const
+ {
+ return join_with_view(std::forward<_Range>(__r), std::forward<_Pattern>(__f));
+ }
+
+ using _RangeAdaptor<_JoinWith>::operator();
+ static constexpr int _S_arity = 2;
+ template
+ static constexpr bool _S_has_simple_extra_args
+ = _LazySplit::_S_has_simple_extra_args<_Pattern>;
+ };
+
+ inline constexpr _JoinWith join_with;
+ } // namespace views
#endif // C++23
} // namespace ranges
diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc
new file mode 100644
index 0000000..efa350f
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc
@@ -0,0 +1,97 @@
+// { dg-options "-std=gnu++23" }
+// { dg-do run { target c++23 } }
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace ranges = std::ranges;
+namespace views = std::views;
+using namespace std::literals;
+
+constexpr bool
+test01()
+{
+ std::string_view rs[] = {"hello", "world"};
+ auto v = rs | views::join_with(' ');
+ VERIFY( ranges::equal(v | views::split(' '), rs, ranges::equal) );
+ auto i = v.begin(), j = v.begin();
+ VERIFY( i == j );
+ ++i;
+ i++;
+ VERIFY( i != j );
+ VERIFY( *i == 'l' );
+ --i;
+ i--;
+ VERIFY( *i == 'h' );
+ return true;
+}
+
+constexpr bool
+test02()
+{
+ std::string_view rs[] = {"the", "quick", "brown", "fox"};
+ auto v = rs
+ | views::transform([](auto x) { return x; })
+ | views::filter([](auto) { return true; });
+ VERIFY( ranges::equal(v | views::join_with(views::empty), "thequickbrownfox"sv) );
+ VERIFY( ranges::equal(v | views::join_with('-'), "the-quick-brown-fox"sv) );
+ VERIFY( ranges::equal(v | views::join_with("--"sv), "the--quick--brown--fox"sv) );
+ VERIFY( ranges::empty(views::empty | views::join_with(0)));
+ VERIFY( ranges::equal(views::single(std::array{42}) | views::join_with(0), (int[]){42}));
+ return true;
+}
+
+constexpr bool
+test03()
+{
+ using __gnu_test::test_input_range;
+ using __gnu_test::test_forward_range;
+ using __gnu_test::test_bidirectional_range;
+
+ using ty1 = ranges::join_with_view>>,
+ views::all_t>>;
+ static_assert(ranges::input_range);
+ static_assert(!ranges::forward_range);
+ static_assert(!ranges::common_range);
+
+ using ty2 = ranges::join_with_view>>,
+ views::all_t>>;
+ static_assert(ranges::forward_range);
+ static_assert(!ranges::bidirectional_range);
+ static_assert(!ranges::common_range);
+
+ using ty3 = ranges::join_with_view>,
+ std::string_view>;
+ static_assert(ranges::bidirectional_range);
+ static_assert(!ranges::random_access_range);
+ static_assert(ranges::common_range);
+
+ return true;
+}
+
+constexpr bool
+test04()
+{
+ std::string rs[] = {"a", "", "b", "", "c"};
+ auto v = rs | views::join_with(' ');
+ VERIFY( ranges::equal(v, "a b c"sv) );
+ auto i = v.begin();
+ auto j = ranges::next(i, 3);
+ ranges::iter_swap(i, j);
+ *j = ranges::iter_move(i);
+ VERIFY( ranges::equal(v, "b b c"sv) );
+ return true;
+}
+
+int
+main()
+{
+ static_assert(test01());
+ static_assert(test02());
+ static_assert(test03());
+ static_assert(test04());
+}
--
cgit v1.1
From 7d8189882fc89f6f410fc9bcf0f8226787316f83 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Mon, 3 Oct 2022 20:53:35 +0100
Subject: libstdc++: Define functions for freestanding
[PR107135]
We don't compile src/c++11/functexcept.cc for freestanding, so just
define the functions used by freestanding entities as inline calls to
std::terminate.
libstdc++-v3/ChangeLog:
PR libstdc++/107135
* include/bits/functexcept.h [!_GLIBCXX_HOSTED]
(__throw_invalid_argument, __throw_out_of_range)
(__throw_out_of_range_fmt, __throw_runtime_error)
(__throw_overflow_error): Define inline.
* include/std/bitset (_M_copy_from_ptr) [!_GLIBCXX_HOSTED]:
Replace __builtin_abort with __throw_invalid_argument.
---
libstdc++-v3/include/bits/functexcept.h | 25 +++++++++++++++++++++++++
libstdc++-v3/include/std/bitset | 8 +-------
2 files changed, 26 insertions(+), 7 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/bits/functexcept.h b/libstdc++-v3/include/bits/functexcept.h
index a78a17b..7fad4b1 100644
--- a/libstdc++-v3/include/bits/functexcept.h
+++ b/libstdc++-v3/include/bits/functexcept.h
@@ -43,6 +43,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+#if _GLIBCXX_HOSTED
// Helper for exception objects in
void
__throw_bad_exception(void) __attribute__((__noreturn__));
@@ -112,6 +113,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void
__throw_bad_function_call() __attribute__((__noreturn__));
+#else // ! HOSTED
+
+ __attribute__((__noreturn__)) inline void
+ __throw_invalid_argument(const char*)
+ { std::__terminate(); }
+
+ __attribute__((__noreturn__)) inline void
+ __throw_out_of_range(const char*)
+ { std::__terminate(); }
+
+ __attribute__((__noreturn__)) inline void
+ __throw_out_of_range_fmt(const char*, ...)
+ { std::__terminate(); }
+
+ __attribute__((__noreturn__)) inline void
+ __throw_runtime_error(const char*)
+ { std::__terminate(); }
+
+ __attribute__((__noreturn__)) inline void
+ __throw_overflow_error(const char*)
+ { std::__terminate(); }
+
+#endif // HOSTED
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index afabeb4..1f3f68f 100644
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -1514,13 +1514,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
else if (_Traits::eq(__c, __one))
_Unchecked_set(__i - 1);
else
- {
-#if _GLIBCXX_HOSTED
- __throw_invalid_argument(__N("bitset::_M_copy_from_ptr"));
-#else
- __builtin_abort();
-#endif
- }
+ __throw_invalid_argument(__N("bitset::_M_copy_from_ptr"));
}
}
--
cgit v1.1
From 7cdab65f3d770345903023f357b6ca96bc85a002 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Mon, 3 Oct 2022 21:49:27 +0100
Subject: libstdc++: Make work freestanding [PR107134]
When gcc/config.gcc defines use_gcc_stdin=wrap, GCC's tries
to use libc's unless -ffreestanding is used.
When libstdc++ is configured --disable-hosted-libstdcxx we want
to work even without -ffreestanding being given. This is a
kluge to make it include GCC's directly even without
-ffreestanding.
libstdc++-v3/ChangeLog:
PR libstdc++/107134
* include/c_global/cstdint [!_GLIBCXX_HOSTED]: Include
directly.
---
libstdc++-v3/include/c_global/cstdint | 59 +++++++++++++++++++++++++++++++++--
1 file changed, 57 insertions(+), 2 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/c_global/cstdint b/libstdc++-v3/include/c_global/cstdint
index 4490d06..4b9df45 100644
--- a/libstdc++-v3/include/c_global/cstdint
+++ b/libstdc++-v3/include/c_global/cstdint
@@ -37,7 +37,11 @@
#include
-#if _GLIBCXX_HAVE_STDINT_H
+#if ! _GLIBCXX_HOSTED && __has_include()
+// For --disable-hosted-libstdcxx we want GCC's own stdint-gcc.h header
+// even when -ffreestanding isn't used.
+# include
+#elif __has_include()
# include
#endif
@@ -80,9 +84,60 @@ namespace std
using ::uintmax_t;
using ::uintptr_t;
#else // !_GLIBCXX_USE_C99_STDINT_TR1
- // Define the minimum needed for , etc.
+
using intmax_t = __INTMAX_TYPE__;
using uintmax_t = __UINTMAX_TYPE__;
+
+#ifdef __INT8_TYPE__
+ using int8_t = __INT8_TYPE__;
+#endif
+#ifdef __INT16_TYPE__
+ using int16_t = __INT16_TYPE__;
+#endif
+#ifdef __INT32_TYPE__
+ using int32_t = __INT32_TYPE__;
+#endif
+#ifdef __INT64_TYPE__
+ using int64_t = __INT64_TYPE__;
+#endif
+
+ using int_least8_t = __INT_LEAST8_TYPE__;
+ using int_least16_t = __INT_LEAST16_TYPE__;
+ using int_least32_t = __INT_LEAST32_TYPE__;
+ using int_least64_t = __INT_LEAST64_TYPE__;
+ using int_fast8_t = __INT_FAST8_TYPE__;
+ using int_fast16_t = __INT_FAST16_TYPE__;
+ using int_fast32_t = __INT_FAST32_TYPE__;
+ using int_fast64_t = __INT_FAST64_TYPE__;
+
+#ifdef __INTPTR_TYPE__
+ using intptr_t = __INTPTR_TYPE__;
+#endif
+
+#ifdef __UINT8_TYPE__
+ using uint8_t = __UINT8_TYPE__;
+#endif
+#ifdef __UINT16_TYPE__
+ using uint16_t = __UINT16_TYPE__;
+#endif
+#ifdef __UINT32_TYPE__
+ using uint32_t = __UINT32_TYPE__;
+#endif
+#ifdef __UINT64_TYPE__
+ using uint64_t = __UINT64_TYPE__;
+#endif
+ using uint_least8_t = __UINT_LEAST8_TYPE__;
+ using uint_least16_t = __UINT_LEAST16_TYPE__;
+ using uint_least32_t = __UINT_LEAST32_TYPE__;
+ using uint_least64_t = __UINT_LEAST64_TYPE__;
+ using uint_fast8_t = __UINT_FAST8_TYPE__;
+ using uint_fast16_t = __UINT_FAST16_TYPE__;
+ using uint_fast32_t = __UINT_FAST32_TYPE__;
+ using uint_fast64_t = __UINT_FAST64_TYPE__;
+#ifdef __UINTPTR_TYPE__
+ using uintptr_t = __UINTPTR_TYPE__;
+#endif
+
#endif // _GLIBCXX_USE_C99_STDINT_TR1
} // namespace std
--
cgit v1.1
From b74ab7a1609f01afaab9b82cfabfb96ae9e1145d Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 4 Oct 2022 09:37:14 +0100
Subject: libstdc++: Enable std::hash> [PR107139]
Everything that depends on is available for freestanding
now.
libstdc++-v3/ChangeLog:
PR libstdc++/107139
* include/std/coroutine: Remove all _GLIBCXXHOSTED preprocessor
conditionals.
---
libstdc++-v3/include/std/coroutine | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/std/coroutine b/libstdc++-v3/include/std/coroutine
index f4189c7..ebaf11d 100644
--- a/libstdc++-v3/include/std/coroutine
+++ b/libstdc++-v3/include/std/coroutine
@@ -39,7 +39,7 @@
# include
#endif
-#if !defined __cpp_lib_three_way_comparison && _GLIBCXX_HOSTED
+#if !defined __cpp_lib_three_way_comparison
# include // for std::less
#endif
@@ -165,11 +165,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
operator<(coroutine_handle<> __a, coroutine_handle<> __b) noexcept
{
-#if _GLIBCXX_HOSTED
return less()(__a.address(), __b.address());
-#else
- return (__UINTPTR_TYPE__)__a.address() < (__UINTPTR_TYPE__)__b.address();
-#endif
}
constexpr bool
@@ -343,7 +339,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} // namespace __n4861
-#if _GLIBCXX_HOSTED
template struct hash;
template
@@ -355,10 +350,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return reinterpret_cast(__h.address());
}
};
-#endif
#else
-#error "the coroutine header requires -fcoroutines"
+#error "the header requires -fcoroutines"
#endif
_GLIBCXX_END_NAMESPACE_VERSION
--
cgit v1.1
From beeb6898fe8ad44731bc58cad7220511b8225797 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 4 Oct 2022 14:18:07 +0100
Subject: libstdc++: Disable test for freestanding
This test checks the exception-safety of std::stable_sort if copying a
value throws. For freestanding we don't allocate in std::stable_sort
anyway, and the exception thrown via __throw_runtime_error terminates,
so disable the test.
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/stable_sort/mem_check.cc: Do nto run
for freestanding.
---
libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc | 2 ++
1 file changed, 2 insertions(+)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc b/libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc
index d1f7690..9dde4fb 100644
--- a/libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc
@@ -15,6 +15,8 @@
// with this library; see the file COPYING3. If not see
// .
+// { dg-require-effective-target hosted }
+
// 25.3.1.2 [lib.stable.sort]
#include
--
cgit v1.1
From 3b8bcc3f8b821e7359f8504334488ff2b1fc8f30 Mon Sep 17 00:00:00 2001
From: Patrick Palka
Date: Tue, 4 Oct 2022 10:54:36 -0400
Subject: libstdc++: Avoid heavyweight std::visit in ranges::join_with_view
libstdc++-v3/ChangeLog:
* include/std/ranges (join_with_view::_Iterator::operator*):
Replace use of std::visit with manual visitation.
(join_with_view::_Iterator::operator++): Likewise.
(join_with_view::_Iterator::operator--): Likewise.
(join_with_view::_Iterator::iter_move): Likewise.
(join_with_view::_Iterator::iter_swap): Likewise.
---
libstdc++-v3/include/std/ranges | 47 +++++++++++++++++++++++++++++++----------
1 file changed, 36 insertions(+), 11 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index d0d6ce6..1f82112 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -7165,18 +7165,23 @@ namespace views::__adaptor
_M_inner_it.template emplace<1>(std::get<1>(std::move(__i._M_inner_it)));
}
- constexpr decltype(auto)
+ constexpr common_reference_t,
+ iter_reference_t<_PatternIter>>
operator*() const
{
- using reference = common_reference_t,
- iter_reference_t<_PatternIter>>;
- return std::visit([](auto& __it) -> reference { return *__it; }, _M_inner_it);
+ if (_M_inner_it.index() == 0)
+ return *std::get<0>(_M_inner_it);
+ else
+ return *std::get<1>(_M_inner_it);
}
constexpr _Iterator&
operator++()
{
- std::visit([](auto& __it){ ++__it; }, _M_inner_it);
+ if (_M_inner_it.index() == 0)
+ ++std::get<0>(_M_inner_it);
+ else
+ ++std::get<1>(_M_inner_it);
_M_satisfy();
return *this;
}
@@ -7232,7 +7237,10 @@ namespace views::__adaptor
}
}
- std::visit([](auto& __it){ --__it; }, _M_inner_it);
+ if (_M_inner_it.index() == 0)
+ --std::get<0>(_M_inner_it);
+ else
+ --std::get<1>(_M_inner_it);
return *this;
}
@@ -7253,18 +7261,35 @@ namespace views::__adaptor
&& equality_comparable<_OuterIter> && equality_comparable<_InnerIter>
{ return __x._M_outer_it == __y._M_outer_it && __x._M_inner_it ==__y._M_inner_it; }
- friend constexpr decltype(auto)
+ friend constexpr common_reference_t,
+ iter_rvalue_reference_t<_PatternIter>>
iter_move(const _Iterator& __x)
{
- using __rval_ref = common_reference_t,
- iter_rvalue_reference_t<_PatternIter>>;
- return std::visit<__rval_ref>(ranges::iter_move, __x._M_inner_it);
+ if (__x._M_inner_it.index() == 0)
+ return ranges::iter_move(std::get<0>(__x._M_inner_it));
+ else
+ return ranges::iter_move(std::get<1>(__x._M_inner_it));
}
friend constexpr void
iter_swap(const _Iterator& __x, const _Iterator& __y)
requires indirectly_swappable<_InnerIter, _PatternIter>
- { std::visit(ranges::iter_swap, __x._M_inner_it, __y._M_inner_it); }
+ {
+ if (__x._M_inner_it.index() == 0)
+ {
+ if (__y._M_inner_it.index() == 0)
+ ranges::iter_swap(std::get<0>(__x._M_inner_it), std::get<0>(__y._M_inner_it));
+ else
+ ranges::iter_swap(std::get<0>(__x._M_inner_it), std::get<1>(__y._M_inner_it));
+ }
+ else
+ {
+ if (__y._M_inner_it.index() == 0)
+ ranges::iter_swap(std::get<1>(__x._M_inner_it), std::get<0>(__y._M_inner_it));
+ else
+ ranges::iter_swap(std::get<1>(__x._M_inner_it), std::get<1>(__y._M_inner_it));
+ }
+ }
};
template
--
cgit v1.1
From 68ed966793526db02fe96605ba9c0f8bbfd59ef0 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 4 Oct 2022 12:57:33 +0100
Subject: libstdc++: Refactor seed sequence constraints in
Every use of _If_seed_seq in and uses it with
enable_if. We can just move the enable_if into the helper alias instead
of repeating it everywhere.
libstdc++-v3/ChangeLog:
* include/bits/random.h (__is_seed_seq): Replace with ...
(_If_seed_seq_for): ... this.
* include/ext/random: Adjust to use _If_seed_seq_for.
---
libstdc++-v3/include/bits/random.h | 39 +++++++++++++++++++++++---------------
libstdc++-v3/include/ext/random | 6 +++---
2 files changed, 27 insertions(+), 18 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index 3e6eb9d..28b37a9 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -198,16 +198,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Engine& _M_g;
};
+ // Detect whether a template argument _Sseq is a valid seed sequence for
+ // a random number engine _Engine with result type _Res.
+ // Used to constrain _Engine::_Engine(_Sseq&) and _Engine::seed(_Sseq&)
+ // as required by [rand.eng.general].
+
template
using __seed_seq_generate_t = decltype(
std::declval<_Sseq&>().generate(std::declval(),
std::declval()));
- // Detect whether _Sseq is a valid seed sequence for
- // a random number engine _Engine with result type _Res.
template>
- using __is_seed_seq = __and_<
+ using _If_seed_seq_for = _Require<
__not_, _Engine>>,
is_unsigned,
__not_>
@@ -263,8 +266,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"template argument substituting __m out of bounds");
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, linear_congruential_engine, _UIntType>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, linear_congruential_engine,
+ _UIntType>;
public:
/** The type of the generated random value. */
@@ -502,8 +506,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"template argument substituting __f out of bound");
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, mersenne_twister_engine, _UIntType>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
+ _UIntType>;
public:
/** The type of the generated random value. */
@@ -702,8 +707,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"template argument substituting __w out of bounds");
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, subtract_with_carry_engine, _UIntType>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
+ _UIntType>;
public:
/** The type of the generated random value. */
@@ -894,8 +900,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename _RandomNumberEngine::result_type result_type;
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, discard_block_engine, result_type>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, discard_block_engine,
+ result_type>;
// parameter values
static constexpr size_t block_size = __p;
@@ -1113,8 +1120,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
"template argument substituting __w out of bounds");
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, independent_bits_engine, _UIntType>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, independent_bits_engine,
+ _UIntType>;
public:
/** The type of the generated random value. */
@@ -1336,8 +1344,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename _RandomNumberEngine::result_type result_type;
template
- using _If_seed_seq = typename enable_if<__detail::__is_seed_seq<
- _Sseq, shuffle_order_engine, result_type>::value>::type;
+ using _If_seed_seq
+ = __detail::_If_seed_seq_for<_Sseq, shuffle_order_engine,
+ result_type>;
static constexpr size_t table_size = __k;
diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random
index 4cc0e25..406b12b 100644
--- a/libstdc++-v3/include/ext/random
+++ b/libstdc++-v3/include/ext/random
@@ -89,9 +89,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template
using _If_seed_seq
- = typename std::enable_if::value
- >::type;
+ = std::__detail::_If_seed_seq_for<_Sseq,
+ simd_fast_mersenne_twister_engine,
+ result_type>;
public:
static constexpr size_t state_size = _M_nstate * (16
--
cgit v1.1
From 6ddbbbffbb5759a6c1d56c191364a6bd021f733e Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 4 Oct 2022 13:00:52 +0100
Subject: libstdc++: Use new built-ins __remove_cv, __remove_reference etc.
libstdc++-v3/ChangeLog:
* include/std/type_traits (remove_cv): Use __remove_cv built-in.
(remove_reference): Use __remove_reference built-in.
(remove_cvref): Use __remove_cvref built-in. Remove inheritance
for fallback implementation.
---
libstdc++-v3/include/std/type_traits | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index a015fd9..b74565e 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -1507,6 +1507,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ typedef _Tp type; };
/// remove_cv
+#if __has_builtin(__remove_cv)
+ template
+ struct remove_cv
+ { using type = __remove_cv(_Tp); };
+#else
template
struct remove_cv
{ using type = _Tp; };
@@ -1522,6 +1527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template
struct remove_cv
{ using type = _Tp; };
+#endif
/// add_const
template
@@ -1570,17 +1576,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Reference transformations.
/// remove_reference
+#if __has_builtin(__remove_reference)
template
struct remove_reference
- { typedef _Tp type; };
+ { using type = __remove_reference(_Tp); };
+#else
+ template
+ struct remove_reference
+ { using type = _Tp; };
template
struct remove_reference<_Tp&>
- { typedef _Tp type; };
+ { using type = _Tp; };
template
struct remove_reference<_Tp&&>
- { typedef _Tp type; };
+ { using type = _Tp; };
+#endif
/// add_lvalue_reference
template
@@ -3358,20 +3370,23 @@ template
*/
#define __cpp_lib_remove_cvref 201711L
+#if __has_builtin(__remove_cvref)
template
struct remove_cvref
- : remove_cv<_Tp>
- { };
+ { using type = __remove_cvref(_Tp); };
+#else
+ template
+ struct remove_cvref
+ { using type = typename remove_cv<_Tp>::type; };
template
struct remove_cvref<_Tp&>
- : remove_cv<_Tp>
- { };
+ { using type = typename remove_cv<_Tp>::type; };
template
struct remove_cvref<_Tp&&>
- : remove_cv<_Tp>
- { };
+ { using type = typename remove_cv<_Tp>::type; };
+#endif
template
using remove_cvref_t = typename remove_cvref<_Tp>::type;
--
cgit v1.1
From 5aa18176add650f481b3b9becbefce6d392cc049 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 4 Oct 2022 17:23:45 +0100
Subject: libstdc++: Fix test FAIL for old std::string ABI
libstdc++-v3/ChangeLog:
* testsuite/std/ranges/adaptors/join_with/1.cc: Remove unused
#include
-#include
-#include
+#include
#include
#include
@@ -73,7 +72,10 @@ test03()
return true;
}
-constexpr bool
+#if _GLIBCXX_USE_CXX11_ABI
+constexpr
+#endif
+bool
test04()
{
std::string rs[] = {"a", "", "b", "", "c"};
@@ -93,5 +95,9 @@ main()
static_assert(test01());
static_assert(test02());
static_assert(test03());
+#if _GLIBCXX_USE_CXX11_ABI
static_assert(test04());
+#else
+ VERIFY(test04());
+#endif
}
--
cgit v1.1
From 85872a69ee1b123557c7c352d45ef608e70b20fb Mon Sep 17 00:00:00 2001
From: GCC Administrator
Date: Wed, 5 Oct 2022 00:17:25 +0000
Subject: Daily bump.
---
libstdc++-v3/ChangeLog | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index be69777..81588d6 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,77 @@
+2022-10-04 Jonathan Wakely
+
+ * testsuite/std/ranges/adaptors/join_with/1.cc: Remove unused
+
+
+ * include/std/type_traits (remove_cv): Use __remove_cv built-in.
+ (remove_reference): Use __remove_reference built-in.
+ (remove_cvref): Use __remove_cvref built-in. Remove inheritance
+ for fallback implementation.
+
+2022-10-04 Jonathan Wakely
+
+ * include/bits/random.h (__is_seed_seq): Replace with ...
+ (_If_seed_seq_for): ... this.
+ * include/ext/random: Adjust to use _If_seed_seq_for.
+
+2022-10-04 Patrick Palka
+
+ * include/std/ranges (join_with_view::_Iterator::operator*):
+ Replace use of std::visit with manual visitation.
+ (join_with_view::_Iterator::operator++): Likewise.
+ (join_with_view::_Iterator::operator--): Likewise.
+ (join_with_view::_Iterator::iter_move): Likewise.
+ (join_with_view::_Iterator::iter_swap): Likewise.
+
+2022-10-04 Jonathan Wakely
+
+ * testsuite/25_algorithms/stable_sort/mem_check.cc: Do nto run
+ for freestanding.
+
+2022-10-04 Jonathan Wakely
+
+ PR libstdc++/107139
+ * include/std/coroutine: Remove all _GLIBCXXHOSTED preprocessor
+ conditionals.
+
+2022-10-04 Jonathan Wakely
+
+ PR libstdc++/107134
+ * include/c_global/cstdint [!_GLIBCXX_HOSTED]: Include
+ directly.
+
+2022-10-04 Jonathan Wakely
+
+ PR libstdc++/107135
+ * include/bits/functexcept.h [!_GLIBCXX_HOSTED]
+ (__throw_invalid_argument, __throw_out_of_range)
+ (__throw_out_of_range_fmt, __throw_runtime_error)
+ (__throw_overflow_error): Define inline.
+ * include/std/bitset (_M_copy_from_ptr) [!_GLIBCXX_HOSTED]:
+ Replace __builtin_abort with __throw_invalid_argument.
+
+2022-10-04 Patrick Palka
+
+ * include/std/ranges: Include for C++23.
+ (__detail::__compatible_joinable_ranges): Define.
+ (__detail::__bidirectional_common): Define.
+ (join_with_view): Define.
+ (join_with_view::_Iterator): Define.
+ (join_with_view::_Sentinel): Define.
+ (views::__detail::__can_join_with_view): Define.
+ (views::_JoinWith, views::join_with): Define.
+ * testsuite/std/ranges/adaptors/join_with/1.cc: New test.
+
+2022-10-04 Arsen Arsenović
+
+ * include/std/iostream: Use ///< for inline documentation.
+ * include/std/limits: Likewise.
+ * include/experimental/internet: Likewise.
+
2022-10-03 Jonathan Wakely
* doc/xml/manual/status_cxx2020.xml: Update C++20 status.
--
cgit v1.1
From dc70f3f81bb980b69a1910c2e6d3774ddd716846 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Thu, 29 Sep 2022 11:30:05 +0100
Subject: libstdc++: Guard use of new built-in with __has_builtin
Another case where I forgot that non-GCC compilers don't have this
built-in yet.
libstdc++-v3/ChangeLog:
* include/bits/invoke.h (__invoke_r): Check
__has_builtin(__reference_converts_from_temporary) before using
built-in.
---
libstdc++-v3/include/bits/invoke.h | 2 ++
1 file changed, 2 insertions(+)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/bits/invoke.h b/libstdc++-v3/include/bits/invoke.h
index 8724a76..8fa8cf8 100644
--- a/libstdc++-v3/include/bits/invoke.h
+++ b/libstdc++-v3/include/bits/invoke.h
@@ -130,8 +130,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
using __result = __invoke_result<_Callable, _Args...>;
using __type = typename __result::type;
+#if __has_builtin(__reference_converts_from_temporary)
static_assert(!__reference_converts_from_temporary(_Res, __type),
"INVOKE must not create a dangling reference");
+#endif
using __tag = typename __result::__invoke_type;
return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
std::forward<_Args>(__args)...);
--
cgit v1.1
From b8473c9a2b8f27b6882b54d012e466e244445733 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Wed, 5 Oct 2022 12:58:57 +0100
Subject: libtdc++: Regenerate Makefile.in after freestanding header changes
libstdc++-v3/ChangeLog:
* include/Makefile.in: Regenerate.
---
libstdc++-v3/include/Makefile.in | 101 +++++++++++++++++++--------------------
1 file changed, 49 insertions(+), 52 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 26d2f6a..9d60755 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -380,13 +380,6 @@ WARN_CXXFLAGS = \
# -I/-D flags to pass when compiling.
AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
-# Regarding *_freestanding:
-# For including files in freestanding, create a new _freestanding variable, and
-# split *_headers across an ``if GLIBCXX_HOSTED'', then update install-headers
-# to account for the new directory/set being added.
-# If such a variable exists, simply add to either *_headers or *_freestanding,
-# as appropriate.
-
# Standard C++ includes.
std_srcdir = ${glibcxx_srcdir}/include/std
std_builddir = .
@@ -395,20 +388,25 @@ std_freestanding = \
${std_srcdir}/array \
${std_srcdir}/atomic \
${std_srcdir}/bit \
+ ${std_srcdir}/bitset \
${std_srcdir}/concepts \
${std_srcdir}/coroutine \
+ ${std_srcdir}/expected \
${std_srcdir}/functional \
${std_srcdir}/iterator \
${std_srcdir}/limits \
${std_srcdir}/memory \
${std_srcdir}/numbers \
+ ${std_srcdir}/numeric \
${std_srcdir}/optional \
${std_srcdir}/ranges \
${std_srcdir}/ratio \
+ ${std_srcdir}/scoped_allocator \
${std_srcdir}/source_location \
${std_srcdir}/span \
${std_srcdir}/tuple \
${std_srcdir}/type_traits \
+ ${std_srcdir}/typeindex \
${std_srcdir}/utility \
${std_srcdir}/variant \
${std_srcdir}/version
@@ -418,7 +416,6 @@ std_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${std_freestanding} \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/any \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/barrier \
-@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/bitset \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/charconv \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/chrono \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/codecvt \
@@ -426,7 +423,6 @@ std_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/condition_variable \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/deque \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/execution \
-@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/expected \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/filesystem \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/forward_list \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/fstream \
@@ -442,12 +438,10 @@ std_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/map \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/memory_resource \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/mutex \
-@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/numeric \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/ostream \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/queue \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/random \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/regex \
-@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/scoped_allocator \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/semaphore \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/set \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/shared_mutex \
@@ -463,7 +457,6 @@ std_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/string_view \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/system_error \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/thread \
-@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/typeindex \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/unordered_map \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/unordered_set \
@GLIBCXX_HOSTED_TRUE@ ${std_srcdir}/valarray \
@@ -478,6 +471,7 @@ bits_freestanding = \
${bits_srcdir}/alloc_traits.h \
${bits_srcdir}/atomic_base.h \
${bits_srcdir}/c++0x_warning.h \
+ ${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/concept_check.h \
${bits_srcdir}/cpp_type_traits.h \
${bits_srcdir}/enable_special_members.h \
@@ -506,6 +500,7 @@ bits_freestanding = \
${bits_srcdir}/stl_iterator.h \
${bits_srcdir}/stl_iterator_base_funcs.h \
${bits_srcdir}/stl_iterator_base_types.h \
+ ${bits_srcdir}/stl_numeric.h \
${bits_srcdir}/stl_heap.h \
${bits_srcdir}/stl_pair.h \
${bits_srcdir}/stl_raw_storage_iter.h \
@@ -528,7 +523,6 @@ bits_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/basic_ios.tcc \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/basic_string.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/basic_string.tcc \
-@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/boost_concept_check.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/char_traits.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/charconv.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/chrono.h \
@@ -601,7 +595,6 @@ bits_freestanding = \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_map.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_multimap.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_multiset.h \
-@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_numeric.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_queue.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_relops.h \
@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/stl_set.h \
@@ -974,49 +967,53 @@ pb_headers7 = \
ext_srcdir = ${glibcxx_srcdir}/include/ext
ext_builddir = ./ext
-ext_headers = \
- ${ext_srcdir}/algorithm \
+ext_freestanding = \
${ext_srcdir}/aligned_buffer.h \
${ext_srcdir}/alloc_traits.h \
${ext_srcdir}/atomicity.h \
- ${ext_srcdir}/bitmap_allocator.h \
${ext_srcdir}/cast.h \
- ${ext_srcdir}/cmath \
- ${ext_srcdir}/codecvt_specializations.h \
${ext_srcdir}/concurrence.h \
- ${ext_srcdir}/debug_allocator.h \
- ${ext_srcdir}/enc_filebuf.h \
- ${ext_srcdir}/extptr_allocator.h \
- ${ext_srcdir}/functional \
- ${ext_srcdir}/iterator \
- ${ext_srcdir}/malloc_allocator.h \
- ${ext_srcdir}/memory \
- ${ext_srcdir}/mt_allocator.h \
- ${ext_srcdir}/new_allocator.h \
- ${ext_srcdir}/numeric \
${ext_srcdir}/numeric_traits.h \
- ${ext_srcdir}/pod_char_traits.h \
+ ${ext_srcdir}/iterator \
${ext_srcdir}/pointer.h \
- ${ext_srcdir}/pool_allocator.h \
- ${ext_srcdir}/random \
- ${ext_srcdir}/random.tcc \
- ${ext_srcdir}/rb_tree \
- ${ext_srcdir}/rc_string_base.h \
- ${ext_srcdir}/rope \
- ${ext_srcdir}/ropeimpl.h \
- ${ext_srcdir}/slist \
- ${ext_srcdir}/sso_string_base.h \
- ${ext_srcdir}/stdio_filebuf.h \
- ${ext_srcdir}/stdio_sync_filebuf.h \
- ${ext_srcdir}/string_conversions.h \
- ${ext_srcdir}/throw_allocator.h \
- ${ext_srcdir}/typelist.h \
${ext_srcdir}/type_traits.h \
- ${ext_srcdir}/vstring_fwd.h \
- ${ext_srcdir}/vstring.h \
- ${ext_srcdir}/vstring.tcc \
- ${ext_srcdir}/vstring_util.h \
- ${ext_compat_headers}
+ ${ext_srcdir}/typelist.h
+
+@GLIBCXX_HOSTED_FALSE@ext_headers = ${ext_freestanding}
+@GLIBCXX_HOSTED_TRUE@ext_headers = \
+@GLIBCXX_HOSTED_TRUE@ ${ext_freestanding} \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/algorithm \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/bitmap_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/cmath \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/codecvt_specializations.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/debug_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/enc_filebuf.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/extptr_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/functional \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/malloc_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/memory \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/mt_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/new_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/numeric \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/pod_char_traits.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/pool_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/random \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/random.tcc \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/rb_tree \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/rc_string_base.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/rope \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/ropeimpl.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/slist \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/sso_string_base.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/stdio_filebuf.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/stdio_sync_filebuf.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/string_conversions.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/throw_allocator.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/vstring_fwd.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/vstring.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/vstring.tcc \
+@GLIBCXX_HOSTED_TRUE@ ${ext_srcdir}/vstring_util.h \
+@GLIBCXX_HOSTED_TRUE@ ${ext_compat_headers}
ext_compat_headers = \
${backward_srcdir}/hash_set \
@@ -1945,9 +1942,6 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${backward_builddir}
for file in ${backward_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${backward_builddir}; done
- $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${ext_builddir}
- for file in ${ext_headers}; do \
- $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${ext_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
for file in ${std_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
@@ -1962,6 +1956,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${ext_builddir}
+ for file in ${ext_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${ext_builddir}; done
@GLIBCXX_HOSTED_TRUE@ for dir in ${pb_subdirs}; do \
@GLIBCXX_HOSTED_TRUE@ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/$${dir} ; done
@GLIBCXX_HOSTED_TRUE@ for file in ${pb_headers1}; do \
--
cgit v1.1
From 966010b2eb4a4c52f139b63548533e7bbd74ec9c Mon Sep 17 00:00:00 2001
From: GCC Administrator
Date: Thu, 6 Oct 2022 00:17:24 +0000
Subject: Daily bump.
---
libstdc++-v3/ChangeLog | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 81588d6..a357c7e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,13 @@
+2022-10-05 Jonathan Wakely
+
+ * include/Makefile.in: Regenerate.
+
+2022-10-05 Jonathan Wakely
+
+ * include/bits/invoke.h (__invoke_r): Check
+ __has_builtin(__reference_converts_from_temporary) before using
+ built-in.
+
2022-10-04 Jonathan Wakely
* testsuite/std/ranges/adaptors/join_with/1.cc: Remove unused
--
cgit v1.1
From 8e2f453de3969c4789b96205febc36d9c3ce022a Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Wed, 5 Oct 2022 11:54:36 +0100
Subject: libstdc++: Use bold style for DR titles in the manual
This matches how the issues are styled in the LWG issues list, and also
allows us to use italics for "cv" (e.g. in issue 2487).
libstdc++-v3/ChangeLog:
* doc/xml/manual/intro.xml: Add role="bold" attribute to
emphasis elements for issue titles.
* doc/html/manual/bugs.html: Regenerate.
---
libstdc++-v3/doc/html/manual/bugs.html | 400 ++++++++++++++++-----------------
libstdc++-v3/doc/xml/manual/intro.xml | 387 ++++++++++++++++---------------
2 files changed, 390 insertions(+), 397 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index 8e0bc1f..58600cd 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -26,597 +26,597 @@
of style. Note that we usually do not make changes to the
code until an issue has reached DR status.
- 5:
- string::compare specification questionable
+ string::compare specification questionable
This should be two overloaded functions rather than a single function.
- 17:
- Bad bool parsing
+ Bad bool parsing
Apparently extracting Boolean values was messed up...
- 19:
- "Noconv" definition too vague
+ "Noconv" definition too vague
If codecvt::do_in
returns noconv
there are
no changes to the values in [to, to_limit)
.
- 22:
- Member open vs flags
+ Member open vs flags
Re-opening a file stream does not clear the state flags.
- 23:
- Num_get overflow result
+ Num_get overflow result
Implement the proposed resolution.
- 25:
- String operator<< uses width() value wrong
+ String operator<< uses width() value wrong
Padding issues.
- 48:
- Use of non-existent exception constructor
+ Use of non-existent exception constructor
An instance of ios_base::failure
is constructed instead.
- 49:
- Underspecification of ios_base::sync_with_stdio
+ Underspecification of ios_base::sync_with_stdio
The return type is the previous state of synchronization.
- 50:
- Copy constructor and assignment operator of ios_base
+ Copy constructor and assignment operator of ios_base
These members functions are declared private
and are
thus inaccessible. Specifying the correct semantics of
"copying stream state" was deemed too complicated.
- 60:
- What is a formatted input function?
+ What is a formatted input function?
This DR made many widespread changes to basic_istream
and basic_ostream
all of which have been implemented.
- 63:
- Exception-handling policy for unformatted output
+ Exception-handling policy for unformatted output
Make the policy consistent with that of formatted input, unformatted
input, and formatted output.
- 68:
- Extractors for char* should store null at end
+ Extractors for char* should store null at end
And they do now. An editing glitch in the last item in the list of
[27.6.1.2.3]/7.
- 74:
- Garbled text for codecvt::do_max_length
+ Garbled text for codecvt::do_max_length
The text of the standard was gibberish. Typos gone rampant.
- 75:
- Contradiction in codecvt::length's argument types
+ Contradiction in codecvt::length's argument types
Change the first parameter to stateT&
and implement
the new effects paragraph.
- 83:
- string::npos vs. string::max_size()
+ string::npos vs. string::max_size()
Safety checks on the size of the string should test against
max_size()
rather than npos
.
- 90:
- Incorrect description of operator>> for strings
+ Incorrect description of operator>> for strings
The effect contain isspace(c,getloc())
which must be
replaced by isspace(c,is.getloc())
.
- 91:
- Description of operator>> and getline() for string<>
- might cause endless loop
+ Description of operator>> and getline() for string<>
+ might cause endless loop
They behave as a formatted input function and as an unformatted
input function, respectively (except that getline
is
not required to set gcount
).
- 103:
- set::iterator is required to be modifiable, but this allows
- modification of keys.
+ set::iterator is required to be modifiable, but this allows
+ modification of keys.
For associative containers where the value type is the same as
the key type, both iterator
and const_iterator
are constant iterators.
- 109:
- Missing binders for non-const sequence elements
+ Missing binders for non-const sequence elements
The binder1st
and binder2nd
didn't have an
operator()
taking a non-const parameter.
- 110:
- istreambuf_iterator::equal not const
+ istreambuf_iterator::equal not const
This was not a const member function. Note that the DR says to
replace the function with a const one; we have instead provided an
overloaded version with identical contents.
- 117:
- basic_ostream uses nonexistent num_put member functions
+ basic_ostream uses nonexistent num_put member functions
num_put::put()
was overloaded on the wrong types.
- 118:
- basic_istream uses nonexistent num_get member functions
+ basic_istream uses nonexistent num_get member functions
Same as 117, but for num_get::get()
.
- 129:
- Need error indication from seekp() and seekg()
+ Need error indication from seekp() and seekg()
These functions set failbit
on error now.
- 130:
- Return type of container::erase(iterator) differs for associative containers
+ Return type of container::erase(iterator) differs for associative containers
Make member erase
return iterator for set
, multiset
, map
, multimap
.
- 136:
- seekp, seekg setting wrong streams?
+ seekp, seekg setting wrong streams?
seekp
should only set the output stream, and
seekg
should only set the input stream.
- 167:
- Improper use of traits_type::length()
+ Improper use of traits_type::length()
op<<
with a const char*
was
calculating an incorrect number of characters to write.
- 169:
- Bad efficiency of overflow() mandated
+ Bad efficiency of overflow() mandated
Grow efficiently the internal array object.
- 171:
- Strange seekpos() semantics due to joint position
+ Strange seekpos() semantics due to joint position
Quite complex to summarize...
- 181:
- make_pair() unintended behavior
+ make_pair() unintended behavior
This function used to take its arguments as reference-to-const, now
it copies them (pass by value).
- 195:
- Should basic_istream::sentry's constructor ever set eofbit?
+ Should basic_istream::sentry's constructor ever set eofbit?
Yes, it can, specifically if EOF is reached while skipping whitespace.
- 206:
-
operator new(size_t, nothrow)
may become
- unlinked to ordinary operator new
if ordinary
- version replaced
-
+ operator new(size_t, nothrow)
may become
+ unlinked to ordinary operator new
if ordinary
+ version replaced
+
The nothrow
forms of new and delete were
changed to call the throwing forms, handling any exception by
catching it and returning a null pointer.
- 211:
- operator>>(istream&, string&) doesn't set failbit
+ operator>>(istream&, string&) doesn't set failbit
If nothing is extracted into the string, op>>
now
sets failbit
(which can cause an exception, etc., etc.).
- 214:
- set::find() missing const overload
+ set::find() missing const overload
Both set
and multiset
were missing
overloaded find, lower_bound, upper_bound, and equal_range functions
for const instances.
- 231:
- Precision in iostream?
+ Precision in iostream?
For conversion from a floating-point type, str.precision()
is specified in the conversion specification.
- 233:
- Insertion hints in associative containers
+ Insertion hints in associative containers
Implement N1780, first check before then check after, insert as close
to hint as possible.
- 235:
- No specification of default ctor for reverse_iterator
+ No specification of default ctor for reverse_iterator
The declaration of reverse_iterator
lists a default constructor.
However, no specification is given what this constructor should do.
- 241:
- Does unique_copy() require CopyConstructible and Assignable?
+ Does unique_copy() require CopyConstructible and Assignable?
Add a helper for forward_iterator/output_iterator, fix the existing
one for input_iterator/output_iterator to not rely on Assignability.
- 243:
- get and getline when sentry reports failure
+ get and getline when sentry reports failure
Store a null character only if the character array has a non-zero size.
- 251:
- basic_stringbuf missing allocator_type
+ basic_stringbuf missing allocator_type
This nested typedef was originally not specified.
- 253:
- valarray helper functions are almost entirely useless
+ valarray helper functions are almost entirely useless
Make the copy constructor and copy-assignment operator declarations
public in gslice_array, indirect_array, mask_array, slice_array; provide
definitions.
- 265:
- std::pair::pair() effects overly restrictive
+ std::pair::pair() effects overly restrictive
The default ctor would build its members from copies of temporaries;
now it simply uses their respective default ctors.
- 266:
- bad_exception::~bad_exception() missing Effects clause
+ bad_exception::~bad_exception() missing Effects clause
The bad_
* classes no longer have destructors (they
are trivial), since no description of them was ever given.
- 271:
- basic_iostream missing typedefs
+ basic_iostream missing typedefs
The typedefs it inherits from its base classes can't be used, since
(for example) basic_iostream<T>::traits_type
is ambiguous.
- 275:
- Wrong type in num_get::get() overloads
+ Wrong type in num_get::get() overloads
Similar to 118.
- 280:
- Comparison of reverse_iterator to const reverse_iterator
+ Comparison of reverse_iterator to const reverse_iterator
Add global functions with two template parameters.
(NB: not added for now a templated assignment operator)
- 292:
- Effects of a.copyfmt (a)
+ Effects of a.copyfmt (a)
If (this == &rhs)
do nothing.
- 300:
- List::merge() specification incomplete
+ List::merge() specification incomplete
If (this == &x)
do nothing.
- 303:
- Bitset input operator underspecified
+ Bitset input operator underspecified
Basically, compare the input character to
is.widen(0)
and is.widen(1)
.
- 305:
- Default behavior of codecvt<wchar_t, char,
- mbstate_t>::length()
+ Default behavior of codecvt<wchar_t, char,
+ mbstate_t>::length()
Do not specify what codecvt<wchar_t, char,
mbstate_t>::do_length
must return.
- 328:
- Bad sprintf format modifier in
- money_put<>::do_put()
+ Bad sprintf format modifier in
+ money_put<>::do_put()
Change the format string to "%.0Lf".
- 365:
- Lack of const-qualification in clause 27
+ Lack of const-qualification in clause 27
Add const overloads of is_open
.
- 387:
- std::complex over-encapsulated
+ std::complex over-encapsulated
Add the real(T)
and imag(T)
members; in C++11 mode, also adjust the existing
real()
and imag()
members and
free functions.
- 389:
- Const overload of valarray::operator[] returns
- by value
+ Const overload of valarray::operator[] returns
+ by value
Change it to return a const T&
.
- 396:
- what are characters zero and one
+ what are characters zero and one
Implement the proposed resolution.
- 402:
- Wrong new expression in [some_]allocator::construct
+ Wrong new expression in [some_]allocator::construct
Replace "new" with "::new".
- 408:
-
+
Is vector<reverse_iterator<char*> > forbidden?
-
+
Tweak the debug-mode checks in _Safe_iterator.
- 409:
- Closing an fstream should clear the error state
+ Closing an fstream should clear the error state
Have open
clear the error flags.
- 415:
- Behavior of std::ws
+ Behavior of std::ws
Change it to be an unformatted input function
(i.e. construct a sentry and catch exceptions).
- 431:
- Swapping containers with unequal allocators
+ Swapping containers with unequal allocators
Implement Option 3, as per N1599.
- 432:
- stringbuf::overflow() makes only one write position
- available
+ stringbuf::overflow() makes only one write position
+ available
Implement the resolution, beyond DR 169.
- 434:
- bitset::to_string() hard to use
+ bitset::to_string() hard to use
Add three overloads, taking fewer template arguments.
- 438:
- Ambiguity in the "do the right thing" clause
+ Ambiguity in the "do the right thing" clause
Implement the resolution, basically cast less.
- 445:
- iterator_traits::reference unspecified for some iterator categories
+ iterator_traits::reference unspecified for some iterator categories
Change istreambuf_iterator::reference
in C++11 mode.
- 453:
- basic_stringbuf::seekoff need not always fail for an empty stream
+ basic_stringbuf::seekoff need not always fail for an empty stream
Don't fail if the next pointer is null and newoff is zero.
- 455:
- cerr::tie() and wcerr::tie() are overspecified
+ cerr::tie() and wcerr::tie() are overspecified
Initialize cerr tied to cout and wcerr tied to wcout.
- 464:
- Suggestion for new member functions in standard containers
+ Suggestion for new member functions in standard containers
Add data()
to std::vector
and
at(const key_type&)
to std::map
.
- 467:
- char_traits::lt(), compare(), and memcmp()
+ char_traits::lt(), compare(), and memcmp()
Change lt
.
- 508:
- Bad parameters for ranlux64_base_01
+ Bad parameters for ranlux64_base_01
Fix the parameters.
- 512:
- Seeding subtract_with_carry_01 from a single unsigned long
+ Seeding subtract_with_carry_01 from a single unsigned long
Construct a linear_congruential
engine and seed with it.
- 526:
- Is it undefined if a function in the standard changes in
- parameters?
+ Is it undefined if a function in the standard changes in
+ parameters?
Use &value.
- 538:
- 241 again: Does unique_copy() require CopyConstructible
- and Assignable?
+ 241 again: Does unique_copy() require CopyConstructible
+ and Assignable?
In case of input_iterator/output_iterator rely on Assignability of
input_iterator' value_type.
- 539:
- partial_sum and adjacent_difference should mention
- requirements
+ partial_sum and adjacent_difference should mention
+ requirements
We were almost doing the right thing, just use std::move
in adjacent_difference.
- 541:
- shared_ptr template assignment and void
+ shared_ptr template assignment and void
Add an auto_ptr<void> specialization.
- 543:
- valarray slice default constructor
+ valarray slice default constructor
Follow the straightforward proposed resolution.
- 550:
- What should the return type of pow(float,int) be?
+ What should the return type of pow(float,int) be?
In C++11 mode, remove the pow(float,int), etc., signatures.
- 581:
-
flush()
not unformatted function
+ flush()
not unformatted function
Change it to be a unformatted output function (i.e. construct a sentry and catch exceptions).
- 586:
- string inserter not a formatted function
+ string inserter not a formatted function
Change it to be a formatted output function (i.e. catch exceptions).
- 596:
- 27.8.1.3 Table 112 omits "a+" and "a+b" modes
+ 27.8.1.3 Table 112 omits "a+" and "a+b" modes
Add the missing modes to fopen_mode.
- 630:
- arrays of valarray
+ arrays of valarray
Implement the simple resolution.
- 660:
- Missing bitwise operations
+ Missing bitwise operations
Add the missing operations.
- 691:
- const_local_iterator cbegin, cend missing from TR1
+ const_local_iterator cbegin, cend missing from TR1
In C++11 mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
- 693:
- std::bitset::all() missing
+ std::bitset::all() missing
Add it, consistently with the discussion.
- 695:
- ctype<char>::classic_table() not accessible
+ ctype<char>::classic_table() not accessible
Make the member functions table and classic_table public.
- 696:
- istream::operator>>(int&) broken
+ istream::operator>>(int&) broken
Implement the straightforward resolution.
- 761:
- unordered_map needs an at() member function
+ unordered_map needs an at() member function
In C++11 mode, add at() and at() const.
- 775:
- Tuple indexing should be unsigned?
+ Tuple indexing should be unsigned?
Implement the int -> size_t replacements.
- 776:
- Undescribed assign function of std::array
+ Undescribed assign function of std::array
In C++11 mode, remove assign, add fill.
- 781:
- std::complex should add missing C99 functions
+ std::complex should add missing C99 functions
In C++11 mode, add std::proj.
- 809:
- std::swap should be overloaded for array types
+ std::swap should be overloaded for array types
Add the overload.
- 853:
- to_string needs updating with zero and one
+ to_string needs updating with zero and one
Update / add the signatures.
- 865:
- More algorithms that throw away information
+ More algorithms that throw away information
The traditional HP / SGI return type and value is blessed
by the resolution of the DR.
- 1203:
- More useful rvalue stream insertion
+ More useful rvalue stream insertion
Return the stream as its original type, not the base class.
- 1339:
- uninitialized_fill_n should return the end of its range
+ uninitialized_fill_n should return the end of its range
Return the end of the filled range.
- 2021:
- Further incorrect uses of
result_of
+ Further incorrect uses of result_of
Correctly decay types in signature of std::async
.
- 2049:
-
is_destructible
underspecified
+ is_destructible
underspecified
Handle non-object types.
- 2056:
- future_errc enums start with value 0 (invalid value for broken_promise)
+ future_errc enums start with value 0 (invalid value for broken_promise)
Reorder enumerators.
- 2059:
- C++0x ambiguity problem with map::erase
+ C++0x ambiguity problem with map::erase
Add additional overloads.
- 2062:
- 2062. Effect contradictions w/o no-throw guarantee of
std::function
swaps
+ 2062. Effect contradictions w/o no-throw guarantee of std::function
swaps
Add noexcept
to swap functions.
- 2063:
- Contradictory requirements for string move assignment
+ Contradictory requirements for string move assignment
Respect propagation trait for move assignment.
- 2064:
- More noexcept issues in basic_string
+ More noexcept issues in basic_string
Add noexcept to the comparison operators.
- 2067:
- packaged_task should have deleted copy c'tor with const parameter
+ packaged_task should have deleted copy c'tor with const parameter
Fix signatures.
- 2101:
- Some transformation types can produce impossible types
+ Some transformation types can produce impossible types
Use the referenceable type concept.
- 2106:
- move_iterator wrapping iterators returning prvalues
+ move_iterator wrapping iterators returning prvalues
Change the reference
type.
- 2108:
- No way to identify allocator types that always compare equal
+ No way to identify allocator types that always compare equal
Define and use is_always_equal
even for C++11.
- 2118:
-
unique_ptr
for array does not support cv qualification conversion of actual argument
+ unique_ptr
for array does not support cv qualification conversion of actual argument
Adjust constraints to allow safe conversions.
- 2127:
- Move-construction with
raw_storage_iterator
+ Move-construction with raw_storage_iterator
Add assignment operator taking an rvalue.
- 2132:
-
std::function
ambiguity
+ std::function
ambiguity
Constrain the constructor to only accept callable types.
- 2141:
-
common_type
trait produces reference types
+ common_type
trait produces reference types
Use decay
for the result type.
- 2144:
- Missing
noexcept
specification in type_index
+ Missing noexcept
specification in type_index
Add noexcept
- 2145:
-
error_category
default constructor
+ error_category
default constructor
Declare a public constexpr constructor.
- 2162:
-
allocator_traits::max_size
missing noexcept
+ allocator_traits::max_size
missing noexcept
Add noexcept
.
- 2187:
-
vector<bool>
is missing emplace
and emplace_back
member functions
+ vector<bool>
is missing emplace
and emplace_back
member functions
Add emplace
and emplace_back
member functions.
- 2192:
- Validity and return type of
std::abs(0u)
is unclear
+ Validity and return type of std::abs(0u)
is unclear
Move all declarations to a common header and remove the
generic abs
which accepted unsigned arguments.
- 2196:
- Specification of
is_*[copy/move]_[constructible/assignable]
unclear for non-referencable types
+ Specification of is_*[copy/move]_[constructible/assignable]
unclear for non-referencable types
Use the referenceable type concept.
- 2212:
-
tuple_size
for const pair
request <tuple>
header
+ tuple_size
for const pair
request <tuple>
header
The tuple_size
and tuple_element
partial specializations are defined in <utility>
which
is included by <array>
.
- 2296:
-
std::addressof
should be constexpr
+ std::addressof
should be constexpr
Use __builtin_addressof
and add
constexpr
to addressof
for C++17 and later.
- 2306:
-
match_results::reference
should be value_type&
, not const value_type&
+ match_results::reference
should be value_type&
, not const value_type&
Change typedef.
- 2313:
-
tuple_size
should always derive from integral_constant<size_t, N>
+ tuple_size
should always derive from integral_constant<size_t, N>
Update definitions of the partial specializations for const and volatile types.
- 2328:
- Rvalue stream extraction should use perfect forwarding
+ Rvalue stream extraction should use perfect forwarding
Use perfect forwarding for right operand.
- 2329:
-
regex_match()/regex_search()
with match_results
should forbid temporary strings
+ regex_match()/regex_search()
with match_results
should forbid temporary strings
Add deleted overloads for rvalue strings.
- 2332:
-
regex_iterator/regex_token_iterator
should forbid temporary regexes
+ regex_iterator/regex_token_iterator
should forbid temporary regexes
Add deleted constructors.
- 2332:
- Unnecessary copying when inserting into maps with braced-init syntax
+ Unnecessary copying when inserting into maps with braced-init syntax
Add overloads of insert
taking value_type&&
rvalues.
- 2399:
-
shared_ptr
's constructor from unique_ptr
should be constrained
+ shared_ptr
's constructor from unique_ptr
should be constrained
Constrain the constructor to require convertibility.
- 2400:
-
shared_ptr
's get_deleter()
should use addressof()
+ shared_ptr
's get_deleter()
should use addressof()
Use addressof
.
- 2401:
-
std::function
needs more noexcept
+ std::function
needs more noexcept
Add noexcept
to the assignment and comparisons.
- 2407:
-
packaged_task(allocator_arg_t, const Allocator&, F&&)
+ packaged_task(allocator_arg_t, const Allocator&, F&&)
should neither be constrained nor explicit
-
+
Remove explicit
from the constructor.
- 2408:
- SFINAE-friendly
+ SFINAE-friendly
common_type
/iterator_traits
is missing in C++14
-
+
Make iterator_traits
empty if any of the
types is not present in the iterator.
Make common_type<>
empty.
- 2415:
- Inconsistency between
unique_ptr
and shared_ptr
+ Inconsistency between unique_ptr
and shared_ptr
Create empty an shared_ptr
from an empty
unique_ptr
.
- 2418:
-
apply
does not work with member pointers
+ apply
does not work with member pointers
Use mem_fn
for member pointers.
- 2440:
-
seed_seq::size()
should be noexcept
+ seed_seq::size()
should be noexcept
Add noexcept
.
- 2441:
- Exact-width atomic typedefs should be provided
+ Exact-width atomic typedefs should be provided
Define the typedefs.
- 2442:
-
call_once()
shouldn't DECAY_COPY()
+ call_once()
shouldn't DECAY_COPY()
Remove indirection through call wrapper that made copies
of arguments and forward arguments straight to std::invoke
.
- 2454:
- Add
raw_storage_iterator::base()
member
-
+ Add raw_storage_iterator::base()
member
+
Add the base()
member function.
- 2455:
- Allocator default construction should be allowed to throw
-
+ Allocator default construction should be allowed to throw
+
Make noexcept
specifications conditional.
- 2458:
- N3778 and new library deallocation signatures
-
+ N3778 and new library deallocation signatures
+
Remove unused overloads.
- 2459:
-
std::polar
should require a non-negative rho
-
+ std::polar
should require a non-negative rho
+
Add debug mode assertion.
- 2465:
- SFINAE-friendly
common_type
is nearly impossible
+ SFINAE-friendly common_type
is nearly impossible
to specialize correctly and regresses key functionality
-
+
Detect whether decay_t
changes either type
and use the decayed types if so.
- 2466:
-
allocator_traits::max_size()
default behavior is incorrect
-
+ allocator_traits::max_size()
default behavior is incorrect
+
Divide by the object type.
- 2484:
-
rethrow_if_nested()
is doubly unimplementable
-
+ rethrow_if_nested()
is doubly unimplementable
+
Avoid using dynamic_cast
when it would be
ill-formed.
- 2487:
-
bind()
should be const
-overloaded
- not cv-overloaded
-
+ bind()
should be const
-overloaded
+ not cv-overloaded
+
Deprecate volatile-qualified operator()
for C++17, make it ill-formed for C++20.
- 2499:
-
operator>>(basic_istream&, CharT*)
makes it hard to avoid buffer overflows
-
+ operator>>(basic_istream&, CharT*)
makes it hard to avoid buffer overflows
+
Replace operator>>(basic_istream&, CharT*)
and other overloads writing through pointers.
- 2537:
- Constructors for
priority_queue
taking allocators
+ Constructors for priority_queue
taking allocators
should call make_heap
-
+
Call make_heap
.
- 2566:
- Requirements on the first template parameter of container adaptors
-
+ Requirements on the first template parameter of container adaptors
+
Add static assertions to enforce the requirement.
- 2583:
- There is no way to supply an allocator for
basic_string(str, pos)
-
+ There is no way to supply an allocator for basic_string(str, pos)
+
Add new constructor.
- 2586:
- Wrong value category used in
scoped_allocator_adaptor::construct()
-
+ Wrong value category used in scoped_allocator_adaptor::construct()
+
Change internal helper for uses-allocator construction
to always check using const lvalue allocators.
- 2684:
-
priority_queue
lacking comparator typedef
-
+ priority_queue
lacking comparator typedef
+
Define the value_compare
typedef.
- 2735:
-
std::abs(short)
,
+ std::abs(short)
,
std::abs(signed char)
and others should return
int
instead of double
in order to be
compatible with C++98 and C
-
+
Resolved by the changes for
2192.
- 2770:
-
tuple_size<const T>
specialization is not
+ tuple_size<const T>
specialization is not
SFINAE compatible and breaks decomposition declarations
-
+
Safely detect tuple_size<T>::value
and
only use it if valid.
- 2781:
- Contradictory requirements for
std::function
+ Contradictory requirements for std::function
and std::reference_wrapper
-
+
Remove special handling for reference_wrapper
arguments and store them directly as the target object.
- 2802:
- Add noexcept to several
shared_ptr
related
+ Add noexcept to several shared_ptr
related
functions
-
+
Add noexcept.
- 2873:
-
shared_ptr
constructor requirements for a deleter
-
+ shared_ptr
constructor requirements for a deleter
+
Use rvalues for deleters.
- 2921:
-
packaged_task
and type-erased allocators
-
+ packaged_task
and type-erased allocators
+
For C++17 mode, remove the constructors taking
an allocator argument.
- 2942:
- LWG 2873's resolution missed
+ LWG 2873's resolution missed
weak_ptr::owner_before
-
+
Add noexcept.
- 2996:
- Missing rvalue overloads for
+ Missing rvalue overloads for
shared_ptr
operations
-
+
Add additional constructor and cast overloads.
- 2993:
-
reference_wrapper<T>
conversion from T&&
-
+ reference_wrapper<T>
conversion from T&&
+
Replaced the constructors with a constrained template,
to prevent participation in overload resolution when not valid.
- 3074:
- Non-member functions for
valarray
should only deduce from the valarray
-
+ Non-member functions for valarray
should only deduce from the valarray
+
Change scalar operands to be non-deduced context, so that
they will allow conversions from other types to the value_type.
- 3076:
-
basic_string
CTAD ambiguity
-
+ basic_string
CTAD ambiguity
+
Change constructors to constrained templates.
- 3096:
-
path::lexically_relative
is confused by trailing slashes
-
+ path::lexically_relative
is confused by trailing slashes
+
Implement the fix for trailing slashes.