From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 846763858C41; Fri, 9 Jun 2023 15:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 846763858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686324932; bh=tI6c2mtoIGI81323RiFjUmAFqlgf2tFKCx+S7GGtlgA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q87MfcBervZssrkB5xmSbxOgl5wRYURG8uK7HRl7Y2R6MW4HL3sB5OPTWxc/Whjsp Ww4tiUx9GGp4gu6aCt0VlREjY4WLh1O30SokYzNBWKpphUNyZKG/vVK6eqIh3KlpcV gVxu9RvrqpiOcwMQViw7VowftcSWC0NcjJ4fmBSM= From: "jack.cui2 at foxmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110195] defaulted constructor does not respect the private accessor Date: Fri, 09 Jun 2023 15:35:32 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jack.cui2 at foxmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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=3D110195 --- Comment #2 from jack --- (In reply to Andrew Pinski from comment #1) > Before C++20, Single{} didn't call the constructor so this behavior is > expected. Could you explain why it didn't call the constructor before c++20? C++ stan= dard rules or compiler make it this way? Really appreciate if you could explain a bit more.=