From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9702138515C9; Fri, 17 Mar 2023 21:16:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9702138515C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679087809; bh=ap44e+Y1HfF+Q7Y5MUA8jSq8goxZJUec495v7EPWDt4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Vve7CxmgajwlV9xxoZCqjhCsXqhKc9UcSVA3yRtE5b7XWkQ6mHOOymWJoAQi+4Pm6 Mtt37bMLVX/UPHciIniS8oisOsoPovBa/gRUnogMVcPA1ve2F2i0+nz+GApFNunlhq jdrbTAkmkdW1pS1BSVF2+7PVDYY5LkY+eiRbKQns= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109159] [10/11/12/13 Regression] explicit constructor is used in copy-initialization Date: Fri, 17 Mar 2023 21:16:49 +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: 12.2.1 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D109159 --- Comment #3 from Marek Polacek --- This hunk broke it: @@ -3251,6 +3251,12 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, goto fail; } + /* Now the explicit specifier might have been deduced; check if this + declaration is explicit. If it is and we're ignoring non-converting + constructors, don't add this function to the set of candidates. */ + if ((flags & LOOKUP_ONLYCONVERTING) && DECL_NONCONVERTING_P (fn)) + return NULL; It doesn't check for BRACE_ENCLOSED_INITIALIZER_P (or some similar flag mea= ning we're initializing from an initializer_list) and that's the bug.=