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

2024-12-19


1443. Default arguments and non-static data members

Section: 9.3.4.7  [dcl.fct.default]     Status: NAD     Submitter: Jason Merrill     Date: 2012-01-13

Consider:

    struct A {
       int i;
       A() { void foo(int=i); }
    };

It's not clear whether that is well-formed or not. It uses this, which might be thought of as a kind of parameter or local variable, which would make the default argument ill-formed. On the other hand, there doesn't seem to be a good reason to ban the code, either.

Rationale (February, 2012):

9.3.4.7 [dcl.fct.default] paragraphs 8-9 should be interpreted as making the example ill-formed.