Skip to content

Commit

Permalink
dev-cpp/range-v3: add gcc10 patch
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/756289
Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Georgy Yakovlev <[email protected]>
  • Loading branch information
gyakovlev committed Nov 24, 2020
1 parent b87e021 commit 519e132
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 1 deletion.
133 changes: 133 additions & 0 deletions dev-cpp/range-v3/files/0.11.0-gcc10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
From a91f0e1be27a31c446452a753001d4518ef83a6b Mon Sep 17 00:00:00 2001
From: Eric Niebler <[email protected]>
Date: Mon, 17 Aug 2020 17:48:09 -0700
Subject: [PATCH] work around premature instantiation problem on gcc; fixes
#1545

---
include/range/v3/view/chunk.hpp | 6 +++---
include/range/v3/view/split.hpp | 26 +++++++++++++-------------
2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/range/v3/view/chunk.hpp b/include/range/v3/view/chunk.hpp
index 0c03cf1eb..b8df13303 100644
--- a/include/range/v3/view/chunk.hpp
+++ b/include/range/v3/view/chunk.hpp
@@ -313,8 +313,8 @@ namespace ranges

public:
inner_view() = default;
- constexpr explicit inner_view(chunk_view_ & view) noexcept
- : rng_{&view}
+ constexpr explicit inner_view(chunk_view_ * view) noexcept
+ : rng_{view}
{}
CPP_auto_member
constexpr auto CPP_fun(size)()(
@@ -338,7 +338,7 @@ namespace ranges
constexpr inner_view read() const
{
RANGES_EXPECT(!done());
- return inner_view{*rng_};
+ return inner_view{rng_};
}
constexpr bool done() const
{
diff --git a/include/range/v3/view/split.hpp b/include/range/v3/view/split.hpp
index facf1b37f..496220e4a 100644
--- a/include/range/v3/view/split.hpp
+++ b/include/range/v3/view/split.hpp
@@ -389,19 +389,19 @@ namespace ranges
split_outer_iterator() = default;

CPP_member
- constexpr explicit CPP_ctor(split_outer_iterator)(Parent & parent)(
+ constexpr explicit CPP_ctor(split_outer_iterator)(Parent * parent)(
/// \pre
requires (!forward_range<Base>))
- : parent_(&parent)
+ : parent_(parent)
{}

CPP_member
- constexpr CPP_ctor(split_outer_iterator)(Parent & parent,
+ constexpr CPP_ctor(split_outer_iterator)(Parent * parent,
iterator_t<Base> current)(
/// \pre
requires forward_range<Base>)
: Current{std::move(current)}
- , parent_(&parent)
+ , parent_(parent)
{}

template(bool Other)(
@@ -519,7 +519,7 @@ namespace ranges
ranges::equal_to> &&
(forward_range<V> || detail::tiny_range<Pattern>)
#endif
- struct RANGES_EMPTY_BASES split_view
+ struct RANGES_EMPTY_BASES split_view
: view_interface<split_view<V, Pattern>, is_finite<V>::value ? finite : unknown>
, private detail::split_view_base<iterator_t<V>>
{
@@ -537,17 +537,17 @@ namespace ranges
#if RANGES_CXX_IF_CONSTEXPR < RANGES_CXX_IF_CONSTEXPR_17
outer_iterator<simple_view<V>()> begin_(std::true_type)
{
- return outer_iterator<simple_view<V>()>{*this, ranges::begin(base_)};
+ return outer_iterator<simple_view<V>()>{this, ranges::begin(base_)};
}
outer_iterator<false> begin_(std::false_type)
{
this->curr_ = ranges::begin(base_);
- return outer_iterator<false>{*this};
+ return outer_iterator<false>{this};
}

outer_iterator<simple_view<V>()> end_(std::true_type) const
{
- return outer_iterator<true>{*this, ranges::end(base_)};
+ return outer_iterator<true>{this, ranges::end(base_)};
}
default_sentinel_t end_(std::false_type) const
{
@@ -580,11 +580,11 @@ namespace ranges
{
#if RANGES_CXX_IF_CONSTEXPR >= RANGES_CXX_IF_CONSTEXPR_17
if constexpr(forward_range<V>)
- return outer_iterator<simple_view<V>()>{*this, ranges::begin(base_)};
+ return outer_iterator<simple_view<V>()>{this, ranges::begin(base_)};
else
{
this->curr_ = ranges::begin(base_);
- return outer_iterator<false>{*this};
+ return outer_iterator<false>{this};
}
#else
return begin_(meta::bool_<forward_range<V>>{});
@@ -596,7 +596,7 @@ namespace ranges
/// \pre
requires forward_range<V> && forward_range<const V>)
{
- return {*this, ranges::begin(base_)};
+ return {this, ranges::begin(base_)};
}
CPP_member
constexpr auto end() //
@@ -604,14 +604,14 @@ namespace ranges
/// \pre
requires forward_range<V> && common_range<V>)
{
- return outer_iterator<simple_view<V>()>{*this, ranges::end(base_)};
+ return outer_iterator<simple_view<V>()>{this, ranges::end(base_)};
}
constexpr auto end() const
{
#if RANGES_CXX_IF_CONSTEXPR >= RANGES_CXX_IF_CONSTEXPR_17
if constexpr(forward_range<V> && forward_range<const V> &&
common_range<const V>)
- return outer_iterator<true>{*this, ranges::end(base_)};
+ return outer_iterator<true>{this, ranges::end(base_)};
else
return default_sentinel;
#else
5 changes: 4 additions & 1 deletion dev-cpp/range-v3/range-v3-0.11.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ KEYWORDS="~amd64 ~ppc64"
IUSE="test"
RESTRICT="!test? ( test )"

PATCHES=( "${FILESDIR}/0.11.0-no-werror.patch" )
PATCHES=(
"${FILESDIR}/0.11.0-no-werror.patch"
"${FILESDIR}/0.11.0-gcc10.patch"
)

src_prepare() {
# header-only libraries go to arch-independent dirs
Expand Down

0 comments on commit 519e132

Please sign in to comment.