Created on 2017-02-06.00:00:00 last changed 26 months ago
Additional note (February, 2022):
The change has been applied editorially with commit 219538.
Notes from the November, 2016 meeting:
This issue is to be resolved editorially and is placed in "review' status until the corresponding change appers in a working draft.
Subclause 9.5.2 [dcl.fct.def.default] paragraph 1 specifies:
A function that is explicitly defaulted shall
- ...
- have the same declared function type (except for possibly differing ref-qualifiers and except that in the case of a copy constructor or copy assignment operator, the parameter type may be “reference to non-const T”, where T is the name of the member function's class) as if it had been implicitly declared,
- ...
Therefore, the following code is ill-formed:
struct S
{
int i;
S(const S&) = default;
S(const volatile S&) = default; // ill-formed
};
volatile S s1;
S s2(s1);
However, C.7.7 [diff.class] paragraph 2 mentions the ability to default such a constructor:
If volatile semantics are required for the copy, a user-declared constructor or assignment must be provided. [ Note: This user-declared constructor may be explicitly defaulted. —end note]
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-09-25 18:08:42 | admin | set | status: review -> cd6 |
2022-02-18 07:47:23 | admin | set | messages: + msg6712 |
2018-02-27 00:00:00 | admin | set | messages: + msg5883 |
2018-02-27 00:00:00 | admin | set | status: open -> review |
2017-02-06 00:00:00 | admin | create |