From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 63EEC3857C4D; Tue, 18 Aug 2020 09:48:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63EEC3857C4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597744100; bh=IFSgeBdc9YvVx4xGDEixM5v4zNX0PHM8iPZ+uJl1nbY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mHVrwBY1MWv/AjZgcMxbsRo/P1tjEKohRN2uiOs9QxlBTRowM5ZlNAMGHoLLDVoRF yUjWLgc5gM7GgTF4Xqt8IVBunY7OHDBSIfIahHTLREa1XWUYNhIz49+LfRjGvQXWR4 LIzuj6BEBR2hsCZVsBij74u792/uP4zi4Gi54OMQ= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/83445] conversion function has too high priority in overload resolution Date: Tue, 18 Aug 2020 09:48:20 +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: 7.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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: Tue, 18 Aug 2020 09:48:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83445 --- Comment #2 from Jonathan Wakely --- Invoking Target(Source const&) is a user-defined conversion too. The conver= sion sequence requires binding a reference to the Source object and then convert= ing it to a Target. In C++17 there is no call to Target(Target const&) or Target(Target&&) beca= use the temporary returned by Source::operator Target() is materialized directly into an object of type Target. Clang agrees with GCC that Source::operator Target() is a better conversion, but I can't find the wording specifying that.=