Created on 2023-11-29.00:00:00 last changed 11 months ago
Suggested resolution:
Add a paragraph before 9.9 [namespace.udecl] paragraph 13 as follows:
The set of declarations named by a using-declarator that inhabits a class C does not include any constructor whose first parameter has type cv C and all of whose remaining parameters (if any) have default arguments.
Constructors that are named by a using-declaration are treated as though they were constructors of the derived class ...
Change in 11.4.5.3 [class.copy.ctor] paragraph 5 as follows:
A declaration of a constructor for a class X is ill-formed if its first parameter is of type cv X and either there are no other parameters or else all other parameters have default arguments.A member function template is never instantiated to produce such a constructor signature.During type deduction for a constructor template of X (13.10.3.1 [temp.deduct.general]), if substitution produces such a constructor signature, type deduction fails. [ Example 5:struct S { template<typename T> S(T); S(); }; S g; void h() { S a(g); //-- end example]does not instantiate the member template to produce S::S<S>(S);no candidate generated from the member template; //usesthe implicitly declared copy constructor is used }
(From submission #474.)
Subclause 11.4.5.3 [class.copy.ctor] paragraph 5 specifies:
A declaration of a constructor for a class X is ill-formed if its first parameter is of type cv X and either there are no other parameters or else all other parameters have default arguments. A member function template is never instantiated to produce such a constructor signature.
It is unclear what happens when such a constructor signature is inherited from a base class. Also, the wording "never instantiated" is not detailed enough.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-12-12 20:35:37 | admin | set | messages: + msg7551 |
2023-11-29 00:00:00 | admin | create |