From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F32FE3857731; Fri, 2 Jun 2023 15:54:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F32FE3857731 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685721243; bh=Y+f2YdnTAZG+SdnvcbUpdIo7qF820niohkpfp45VNnQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UuIf+0lBmp3kqbS43ztPkW1b4FtdNjKrsEFdvcD9NcRdqTYgRQ0R09FjdTSYjTDYU ikfeyiHkIlCFf9H13AauRj/UONYghm9ty63UDHdWtQ4weK/bEiDCvqqpK1swY0R/Wr I1ijA1TlEUuoSR+4Rjb741rNNLTSjk3CDH1MmHa4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109247] [13/14 Regression] optional o; o = {x}; wants to use explicit optional(U) constructor since r13-6765-ga226590fefb35ed6 Date: Fri, 02 Jun 2023 15:54:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: SUSPENDED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109247 --- Comment #17 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:9872d56661ade358c440914361c1ebdccd975bec commit r14-1502-g9872d56661ade358c440914361c1ebdccd975bec Author: Jason Merrill Date: Fri May 26 12:28:15 2023 -0400 c++: fix explicit/copy problem [PR109247] In the testcase, the user wants the assignment to use the operator=3D declared in the class, but because [over.match.list] says that explicit construc= tors are also considered for list-initialization, as affirmed in CWG1228, we= end up choosing the implicitly-declared copy assignment operator, using the explicit constructor template for the argument, which is ill-formed. O= ther implementations haven't implemented CWG1228, so we keep getting bug reports. Discussion in CWG led to the idea for this targeted relaxation: if we u= se an explicit constructor for the conversion to the argument of a copy or mo= ve special member function, that makes the candidate worse than another. DR 2735 PR c++/109247 gcc/cp/ChangeLog: * call.cc (sfk_copy_or_move): New. (joust): Add tiebreaker for explicit conv and copy ctor. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist-explicit3.C: New test.=