From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36CC93858D20; Sat, 3 Dec 2022 18:46:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36CC93858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670093200; bh=dUKFzKt0K/h334Fq/8wqSXTv54OLDF66udWazEQI+68=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MAeFuyyWbHTV3uSWdnDY/f0tkQHnkE3pXFrak91qt/q/RqEcTmJuaiZAUg0Q0KcJ1 yLezwre1uWOBDzICjTuY5CpP0wy4jrras1AErwy8bqE4qCnFrrRryr7WSax76zHt7U v5AMRrWv72C3GbcU/9/cVBy6qfVgDjePLYKaPNag= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107958] Ambiguity with uniform initialization in overloaded operator and explicit constructor Date: Sat, 03 Dec 2022 18:46:40 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107958 --- Comment #6 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > I think GCC and MSVC are correct here: > [over.match.list]/16.3.1.7 > . In copy-listinitialization, if an explicit constructor is chosen, the > initialization is ill-formed. [ Note: This differs from > other situations (16.3.1.3, 16.3.1.4), where only converting constructors > are considered for copy-initialization. > This restriction only applies if this initialization is part of the final > result of overload resolution. =E2=80=94 end note ] >=20 >=20 > Even though the note is techincally not part of the standard, it describes > why clang is wrong here. That is the explicit constructors are used too to > figure out the overload and only if there was no ambiguous, it would be > considered as ill-formed. Also see clang bug https://github.com/llvm/llvm-project/issues/28016=