Created on 2026-04-21.00:00:00 last changed 2 days ago
Possible resolution:
Change in 9.3.4.6 [dcl.fct] paragraph 2 as follows and split into two paragraphs:
The parameter-declaration-clause determines the arguments that can be specified, and their processing, when the function is called. [Note 1: The parameter-declaration-clause is used to convert the arguments specified on the function call; see 7.6.1.3 [expr.call]. —end note] If the parameter-declaration-clause is empty, the function takes no arguments. A parameter list (void) and, for a non-templated function, a parameter list consisting of a single unnamed non-object parameter of
non-dependenttype voidisare equivalent to an empty parameter list. Except forthisthese specialcasecases, a parameter shall not have type cv void. A parameter with volatile-qualified type is deprecated; see D.4 [depr.volatile.type].If the parameter-declaration-clause terminates with an ellipsis or a function parameter pack (13.7.4 [temp.variadic]), the number of arguments shall be equal to or greater than the number of parameters that do not have a default argument and are not function parameter packs. Where syntactically correct and where “...” is not part of an abstract-declarator , “...” is synonymous with “, ...”. A parameter-declaration-clause of the form parameter-declaration-list ... is deprecated (D.5 [depr.ellipsis.comma]). ...
(From submission #889.)
Consider:
template<class T>
struct S {
using U = decltype((void)(T*)0);
void f(U); // zero parameters or IFNDR (any instantiation forms an ill-formed parameter of type void)?
};
The current phrasing in 9.3.4.6 [dcl.fct] paragraph 2 is the result of core issues 577 and 2915. The current rule, enabling typedefs for void, is primarily motivated by C compatibility.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-04-22 19:40:07 | admin | set | messages: + msg8545 |
| 2026-04-21 00:00:00 | admin | create | |