-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Full name of submitter: Brian Bi
Issue description: [dcl.type.class.deduct]/1 states: "[...] The placeholder is replaced by the return type of the function selected by overload resolution for class template deduction ([over.match.class.deduct])". However, [over.match.class.deduct]/5 states: "Initialization and overload resolution are performed as described in [dcl.init] and [over.match.ctor], [over.match.copy], or [over.match.list] [...] where the guides of the template named by the placeholder are considered to be the constructors of that class type for the purpose of forming an overload set [...]"
- Constructors do not have return types.
- The constructor formulation is also unclear as to whether the simple-template-id of a deduction-guide participates in SFINAE.
- Stating that initialization is performed is at odds with existing behavior of implementations, which do not check the semantic constraints of initialization. For example, all implementations treat class template argument deduction as successful in the below example, despite the private constructor of
X
:
template <class T>
struct S {
S(...);
};
class X {
private:
X(int);
};
template <class T>
S(T, X) -> S<T>;
S s(1, 1);
Metadata
Metadata
Assignees
Labels
No labels