From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C2333895473; Thu, 28 May 2020 01:48:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C2333895473 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590630506; bh=EYhlfB+GBo0WKW3ijkbmtbpYoJYZLNr1LO33TTWDLxQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uyErF4UYybIL5N3zHHQ17JkjNXz9iMhavMT9SJ254Y1Veka1u/Z7giT0ClSuTDtLx RlUaGP+lxdEIz9GJz79ZBpOmL5Jeis/bZv2IBaNSXZM8me1sY51SWcV4HprrUDghWV AtsYrvXRDFl7pgs9qN4vute9ImykQ0kRK7nrt7BQ= 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: Thu, 28 May 2020 01:48:25 +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: Thu, 28 May 2020 01:48:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95322 --- Comment #11 from CVS Commits --- The releases/gcc-10 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:fc78e991c35a5ee14efafb4e5566a9570fa31dd4 commit r10-8194-gfc78e991c35a5ee14efafb4e5566a9570fa31dd4 Author: Patrick Palka Date: Tue May 26 16:17:34 2020 -0400 libstdc++: Fix common_iterator::operator-> [PR95322] This patch fixes the definition of common_iterator::operator-> when the underlying iterator's operator* returns a non-reference. The first problem is that the class __detail::_Common_iter_proxy is used unqualified. Fixing that revealed another problem: the class's template friend declaration of common_iterator doesn't match up with the definition of common_iterator, because the friend declaration isn't constrained. If we try to make the friend declaration match up by adding constraints, we run into frontend bug PR93467. So we currently can't correctly express this friend relation between __detail::_Common_iter_proxy and common_iterator. As a workaround to this frontend bug, this patch moves the definition of _Common_iter_proxy into the class template of common_iterator so that we could instead express the friend relation via the injected-class-name. (This bug was found when attempting to use views::common to work around the compile failure with the testcase in PR95322.) libstdc++-v3/ChangeLog: PR libstdc++/95322 * include/bits/stl_iterator.h (__detail::_Common_iter_proxy): Remove and instead define it ... (common_iterator::_Proxy): ... here. (common_iterator::operator->): Use it. * testsuite/24_iterators/common_iterator/2.cc: New test. * testsuite/std/ranges/adaptors/95322.cc: New test. (cherry picked from commit 3bf5e7657b752cc2352778e8c20ac9cdddca4f93)=