diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-02-26 08:38:06 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-02-26 10:24:00 -0500 |
commit | 8ce13842b50cbd2676f2e322995182af20df31fe (patch) | |
tree | 9b4562ea19b57365554d59dc9d0df45721634730 /libstdc++-v3/include | |
parent | fd335985582cbb9de3a08e071e652bb38960b493 (diff) | |
download | gcc-8ce13842b50cbd2676f2e322995182af20df31fe.zip gcc-8ce13842b50cbd2676f2e322995182af20df31fe.tar.gz gcc-8ce13842b50cbd2676f2e322995182af20df31fe.tar.bz2 |
libstdc++: Fix use of inaccessible private member in split_view (PR93936)
We are calling _OuterIter::__current from _InnerIter::operator==, but the former
is private within this non-member friend. Fix this by calling
_OuterIter::operator== instead, which does the right thing here.
libstdc++-v3/ChangeLog:
PR libstdc++/93936
* include/std/ranges (split_view::_InnerIter::operator==): Compare
the operands' _M_i rather than their _M_i.current().
* testsuite/std/ranges/adaptors/split.cc: Augment test.
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/ranges | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index d832663..bad89c5 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -2841,7 +2841,7 @@ namespace views friend constexpr bool operator==(const _InnerIter& __x, const _InnerIter& __y) requires forward_range<_Base> - { return __x._M_i.__current() == __y._M_i.__current(); } + { return __x._M_i == __y._M_i; } friend constexpr bool operator==(const _InnerIter& __x, default_sentinel_t) |