From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8048 invoked by alias); 26 Apr 2013 14:05:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7551 invoked by uid 48); 26 Apr 2013 14:05:25 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57082] New: brace initialization requires public destructor Date: Fri, 26 Apr 2013 14:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02178.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57082 Bug #: 57082 Summary: brace initialization requires public destructor Classification: Unclassified Product: gcc Version: 4.7.3 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: redi@gcc.gnu.org struct X { private: ~X() {} }; int main() { new X; // OK new X(); // OK new X{}; // ERROR } x.cc: In function 'int main()': x.cc:4:3: error: 'X::~X()' is private ~X() {} ^ x.cc:11:9: error: within this context new X{}; ^