Created on 2010-08-02.00:00:00 last changed 130 months ago
[Voted into the WP at the November, 2010 meeting.]
Proposed resolution (August, 2010):
Change 9.3.4.6 [dcl.fct] paragraph 5 as follows:
...After producing the list of parameter types,several transformations take place upon these types to determine the function type. Anyany top-level cv-qualifiers modifying a parameter typeisare deleted when forming the function type.[Example: the type void(*)(const int) becomes void(*)(int) —end example] Such cv-qualifiers affect only the definition of the parameter within the body of the function; they do not affect the function type. If a storage-class-specifier modifies a parameter type, the specifier is deleted. [Example: register char* becomes char* —end example] Such storage-class-specifiers affect only the definition of the parameter within the body of the function; they do not affect the function type.The resulting list of transformed parameter types and the presence or absence of the ellipsis or a function parameter pack is the function's parameter-type-list. [Note: This transformation does not affect the types of the parameters. For example, int(*)(const int p, decltype(p)*) and int(*)(int, const int*) are identical types. —end note]
The description of decltype does not specify whether the type of a parameter is the declared type or the type as adjusted in 9.3.4.6 [dcl.fct] paragraph 5:
auto f(int a[])->decltype(a); // ill-formed or int*? auto g(const int i)->decltype(i); // int or const int?
Suggested resolution: Clarify the wording to indicate that the type of a parameter is after the array- and function-to-pointer decay but before the removal of cv-qualification.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | status: dr -> fdis |
2010-11-29 00:00:00 | admin | set | messages: + msg3165 |
2010-11-29 00:00:00 | admin | set | status: ready -> dr |
2010-08-23 00:00:00 | admin | set | messages: + msg2779 |
2010-08-02 00:00:00 | admin | create |