https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100290
Bug ID: 100290
Summary: join_view::_Iterator::operator++ copies
_M_parent->_M_inner when _S_ref_is_glvalue is false
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
auto&& __inner_range = [this] () -> decltype(auto) {
if constexpr (_S_ref_is_glvalue)
return *_M_outer;
else
return _M_parent->_M_inner;
}();
This is a copy in the else case due to decltype(auto) producing the declared
type of _M_inner. The lambda should return auto&&.