You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each of these contexts defines the set of candidate functions and the list of arguments in its own unique way.
However, [over.match.ctor] is not clear for the argument list of the default-initialization context. [over.match.ctor] only says
The argument list is the expression-list or assignment-expression of the initializer.
Neither expression-list nor assignment-expression can be empty. We should explicitly specify the list for default-initialization. Append that
or empty for default-initialization.
This can clarify [over.match.viable] p2
First, to be a viable function, a candidate function shall have enough parameters to agree in number with the arguments in the list.
[...]
A candidate function having more than m parameters is viable only if all parameters following the
mth have default arguments ([dcl.fct.default]). For the purposes of overload resolution, the parameter list is truncated on the right, so that there are exactly m parameters.
And the relative example in [over.match.best.general] 2.7
structA {
A(int = 0);
};
structB: A {
using A::A;
B();
};
intmain() {
B b; // OK, B::B()
}
we expect the number of the arguments in the list is zero in the default-initialization, therefore A::A(int) is considered to have zero parameters for the purpose of the overload resolution as per [over.match.viable] p2.
The text was updated successfully, but these errors were encountered:
Since [over.match.general] p2 says
However, [over.match.ctor] is not clear for the argument list of the default-initialization context. [over.match.ctor] only says
Neither expression-list nor assignment-expression can be empty. We should explicitly specify the list for default-initialization. Append that
This can clarify [over.match.viable] p2
And the relative example in [over.match.best.general] 2.7
we expect the number of the arguments in the list is zero in the default-initialization, therefore A::A(int) is considered to have zero parameters for the purpose of the overload resolution as per [over.match.viable] p2.
The text was updated successfully, but these errors were encountered: