From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85BC33858D28; Thu, 16 Mar 2023 19:51:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85BC33858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678996308; bh=+doRbAOepHWSJ7KEko8VW5odgtOlVH/51EeiagPS0rs=; h=From:To:Subject:Date:From; b=nBmRPXI/FgXDYIPHJx4Cq9mBODQ75YIMWUIILTK2m2Ky7GOUwzXsE139kCWBHp8mJ Q0N+T6Bq4Dnc2kJIXYP63+gFsNvWTqWJg7V5mZTfLom+2MJ7KNQJfTLO2rR35RA0MC JqKTTuRRBd97JBXSXvOw2JAKwllig3yh3VUSDVCY= From: "fchelnokov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109159] New: explicit constructor is used in copy-initialization Date: Thu, 16 Mar 2023 19:51:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fchelnokov at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 109159 Summary: explicit constructor is used in copy-initialization Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- The following code must be accepted (as it does in Clang and MSVC): struct A { A( float ) {} template explicit A( U ) {} }; template concept CopyFromIntList =3D requires( T t ) { t =3D { 1 }; }; static_assert( !CopyFromIntList ); because 't =3D {1}' is invalid: chosen constructor is explicit in copy-initialization. But in GCC static_assert fails. Online demo: https://gcc.godbolt.org/z/Pf47E6dno=