From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC360395B0A3; Wed, 27 May 2020 21:08:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC360395B0A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590613703; bh=ejHYgjoAtVkYoGJVnN2FoUBCwkwcYx6QqoYqN2Vm1IQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RwfgseKm2y+ZkrX0NMnYT31STGFz6KFi1R8WRU+wbMW9Jmlixq5p0rAd7DQNNfF3i Xf8IpdX2FiUFka5hRMEfVJ2tgUQYrGVhvrWgJHyO92QA/7EuSpL+SKAl/rgyBmemDY HWj6zDwsze6zS3DepAk6aA1XJQjJF+2EMpzJglw4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95322] std::list | take | transform, expression does not work cbegin() == end() Date: Wed, 27 May 2020 21:08:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.1.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 21:08:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95322 --- Comment #9 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:6c2582c0406250c66e2eb3651f8e8638796b7f53 commit r11-673-g6c2582c0406250c66e2eb3651f8e8638796b7f53 Author: Jonathan Wakely Date: Wed May 27 22:08:15 2020 +0100 libstdc++: Fix view adaptors for mixed-const sentinels and iterators (PR 95322) The bug report is that transform_view's sentinel cannot be compared to its iterator. The comparison is supposed to use operator=3D=3D(iterator, sentinel) after converting sentinel to sentinel. However, the operator=3D=3D is a hid= den friend so is not a candidate when comparing iterator with sentinel. The required conversion would only happen if we'd found the operator, but we can't find the operator until after the conversion happens. A new LWG issue has been reported, but not yet assigned a number. The solution suggested by Casey Carter is to make the hidden friends of the sentinel types work with iterators of any const-ness, so that no conversions are required. Patrick Palka observed that join_view has a similar problem and a similar fix is used for its sentinel. PR libstdc++/95322 * include/std/ranges (transform_view::_Sentinel): Allow hidden friends to work with _Iterator and _Iterator. (join_view::_Sentinel): Likewise. * testsuite/std/ranges/adaptors/95322.cc: New test.=