From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 983723858C66; Fri, 23 Feb 2024 14:42:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 983723858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708699353; bh=tiDdp5QQEUDr5+nyARiT7Vg+2IcVEFEZ8f5WqhYCrWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WaPsfGEhqIUA7OZfEUBI2Xa8BAVtbsTyK4tLTqmZTSEvc31/U44DocaouxJYRJ/Rc XwKEn8aCMSLhNurdjiil1vk8T0FDbfURE+t2I6o47X8ISbaQleJh0k6rMvtkmDKOnC BjLwPi2c8G8K2z+1+de0apDsCNvsTyw4+7IY9Zw4= From: "de34 at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114076] list-initialization with assignment expression triggers wrong template instanciation Date: Fri, 23 Feb 2024 14:42:33 +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.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: de34 at live dot cn 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: cc 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=3D114076 Jiang An changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |de34 at live dot cn --- Comment #1 from Jiang An --- Looks like a duplicate of Bug 104850 to me. GCC cares about the difference between direct/copy of initialization, not whether list-initialization or not (however, it's unfortunately that direct-non-list-initialization can't be used). > In case c, the rejection seems to me to be correct, since here the tempor= ary > value must be destroyed by a destructor call. I don't see why there's even a temporary value since C++17. The prvalue is = used to initialize the data member (via temporary materialization). The potential invocation of destructor should be in the body of constructors.=