From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19051 invoked by alias); 19 Aug 2013 18:30:04 -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 19014 invoked by uid 48); 19 Aug 2013 18:30:02 -0000 From: "dushistov at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58194] New: default argument for constructor outside of class DR 1344 Date: Mon, 19 Aug 2013 18:30: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-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dushistov at mail dot ru X-Bugzilla-Status: UNCONFIRMED 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00965.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58194 Bug ID: 58194 Summary: default argument for constructor outside of class DR 1344 Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dushistov at mail dot ru Such simple code accepted by gcc 4.8.1: struct Foo { Foo(const char *); }; Foo::Foo(const char *str = 0) { } There is DR 1344 about it: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1344 and according to disscussion in clang mailing list: http://clang-developers.42468.n3.nabble.com/Reason-for-Diagnostic-on-default-ctors-redeclaration-td4032117.html Quote: This was last discussed by WG21 at the Bloomington meeting. Notes from there: "Consensus: Make this ill-formed as suggested in the write-up. Core issue 1344. Priority 0, Doug drafting." So it would be nice, if gcc emit error on such bad code.