From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 33DA83858D26; Sun, 16 Jun 2024 18:53:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33DA83858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718564021; bh=fYK+Najie3lnh2SFhY2X7H+WYKfOzt73+ZF3TqfoVZY=; h=From:To:Subject:Date:From; b=xiahXPipkrKlHXMS+CilbFpR9h2K1aC+TRPAIrVDFVqislcFSQCSiG6niIbhNOz/A pHhGeaK9uEKPoKvzGr8NjV5wlmBsYREpzwUEtLjEWqdCwRz/8jDa7H401exGZ71tXy /d3l462whBFZJkaUC2g+MdXpw4zeicxnT+4pw0u0= From: "frankhb1989 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/115514] New: Nonconforming reverse_iterator::operator-> Date: Sun, 16 Jun 2024 18:53:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: frankhb1989 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115514 Bug ID: 115514 Summary: Nonconforming reverse_iterator::operator-> Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: frankhb1989 at gmail dot com Target Milestone: --- The last comment in LWG 1052 says "the wording in [reverse.iter.elem] (of P0896R4) for operator-> is equivalent to the PR for LWG 1052"; unfortunately this is not true. The adopted wording in P0896R4 uses `prev` which returns a prvalue for the call to `operator->`, while the PR uses an lvalue `tmp` for= the call to `operator->`. Since `->` is no longer concerned in C++20's iterator requirements, there can be observable differences when the iterator having overloaded `operator->` with different ref-qualifiers in spite of the equivalence to the expression formed by `operator*` (for lvalues). The implementation in libc++ follows the standard wording literally. Actual= ly the original implementation (https://reviews.llvm.org/D120180) has an expli= cit `std::move`, suggesting the difference has been acknowledged. (Another difference is it only applies the resolution for C++17 onward.)=