Closed wg21bot closed 1 year ago
Maybe interesting as a clarification but as you can't avoid providing an implicit object parameter before the dot there is no way that the default argument would ever be used. I noted that at least in the MSVC implementation the pointer type is a function pointer (not a member function pointer), but this does not mean that a default expression would be usable.
Accept the proposed resolution to GB-051, and forward this to CWG. | SF | F | N | A | SA |
---|---|---|---|---|---|
7 | 8 | 5 | 0 | 0 |
Result: Consensus
Note the example is incorrect, however the 'default'-ness issue was understood in the room.
struct S { void f(this const S &= S{}); };
CWG2653
CWG 2022-11-08: Accepted with Modifications. See CWG2653 for details.
The syntax and semantics appear to allow:
This is probably no more than an oddity, but perhaps it should be prevented.
Strike this[opt] at the 2nd and 4th occurrence in the grammar of parameter-declaration. Add a Note: an explicit-object-parameter-declaration cannot have an initializer-clause.