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.

Reply via email to