This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


26. Copy constructors and default arguments

Section: 11.4.5.3  [class.copy.ctor]     Status: NAD     Submitter: Daveed Vandevoorde     Date: 22 Sep 1997

The working paper is quite explicit about

    struct X {
         X(X, X const& = X());
    };
being illegal (because of the chicken & egg problem wrt copying.)

Shouldn't it be as explicit about the following?

    struct Y {
        Y(Y const&, Y = Y());
    };
Rationale: There is no need for additional wording. This example leads to a program which either fails to compile (due to resource limits on recursive inlining) or fails to run (due to unterminated recursion). In either case the implementation may generate an error when the program is compiled.