Title
Default arguments and non-static data members
Status
nad
Section
9.3.4.7 [dcl.fct.default]
Submitter
Jason Merrill

Created on 2012-01-13.00:00:00 last changed 147 months ago

Messages

Date: 2012-02-15.00:00:00

Rationale (February, 2012):

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

Date: 2022-11-20.07:54:16

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.

History
Date User Action Args
2012-02-27 00:00:00adminsetmessages: + msg3845
2012-02-27 00:00:00adminsetstatus: open -> nad
2012-01-13 00:00:00admincreate