From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 63AD53858407; Wed, 21 Jul 2021 14:24:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63AD53858407 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/101542] __gnu_cxx::sequence_buffer const copy constructor is badly broken Date: Wed, 21 Jul 2021 14:24:30 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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, 21 Jul 2021 14:24:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101542 --- Comment #3 from Jonathan Wakely --- (In reply to Brooks Moses from comment #0) > This started failing with a recent Clang change > (https://github.com/llvm/llvm-project/commit/ > 7d2d5a3a6d7aaa40468c30250bf6b0938ef02c08), described as "Apply P1825 as > Defect Report from C++11 up to C++20". See > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1825r0.html for = the > defect report details. I would guess that GCC will be applying a similar > change. GCC 11 already implemented that, see PR 91427 and the commit https://gcc.gnu.org/g:1722e2013f05f1f1f99379dbaa0c0df356da731f The for that commit says: Discussion on the CWG reflector about how to avoid breaking the PR91212 test in the new model settled on the model of doing only a single overload resolution, with the variable treated as an xvalue that can bind to non-const lvalue references. So this patch implements that approach. = The implementation does not use the existing LOOKUP_PREFER_RVALUE flag, but instead sets a flag on the representation of the static_cast turning the variable into an xvalue. which says that calling sequence_buffer(sequence_buffer&) here is intended, which is why we didn't see any change in the ext/rope/4.cc test when GCC implemented it. I still think we want to make sequence_buffer move-aware, so that you get t= he same behaviour for: template T f(T x) { return x; } template T g(T x) { return std::move(x); } when passed a sequence_buffer.=