New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[over.best.ics.general] The type of parameter is unclear #5369
Comments
Putting two entirely different topics into the same issue is unhelpful; please split. Regarding the first issue, this is probably CWG1668. In particular, "This transformation does not affect the types of the parameters." wants to say "does not affect the types of the parameter variables." In your example, the parameter type (both as appearing in the function type and as the type of the parameter variable) is "pointer to function". |
Yes, we agree that the type of the parameter is a bit unclear when it refers to in different contexts.
A different perspective to CWG1668 is that this issue is talking about the type of the parameter from the view of the declaration. [basic.pre] p5 says
Anyway, the parameter-declaration
should also affect the type of the parameter whenever the determination of the type of such a parameter is required. Furthermore, we should also clearly state what the type of a parameter is when the type is used in overload resolution(i.e. the type of the parameter or the type of the parameter in the function type).
I have done that. Please check it. |
[over.best.ics.general] p1 says
[over.best.ics.general] p6 says
Consider this example:
Is the type of the parameter
a
be considered asfunction of () returning int
or "pointer to function of () returning int" that is after adjustment?Since [dcl.fct.note] p3 says
The parameter-declaration
int a()
matches [dl.fct] and thus it's original type is function type. Does the type of the parameter mean the type of the parameter in parameter-type-list? Such asFor the purpose of defining implicit conversion sequence, the type of
a
andb
arepointer to function of () returning int
andint
, respectively.BTW, the adjustment for the types of parameters that is "array of T" or "function type T" does not only affect parameter-type-list but also affect the type when determining the type of the entity, such as the result of
decltype(a)
ispointer to function of () returning int
rather thanfunction of () returning int
butdecltype(b)
is exactlyconst int
. [dcl.fct] p5 may need to be improved to make that meaning clear.This sounds like all transformations only affect the determination of the function's parameter-type-list.
The text was updated successfully, but these errors were encountered: