Full name of submitter (unless configured in github; will be published with the issue): Jim X
[dcl.spec.auto.general] p2 says
if it is not the auto type-specifier introducing a trailing-return-type (see below), is a generic parameter type placeholder of the function declaration or lambda-expression.
Consider this example
void fun(auto(*)(int)->auto){
}
The auto type-specifier does introduce a trailing-return-type, so the specified type is not a generic parameter type placeholder?
Divergence: Clang accepts this example but GCC rejects it.
It seems to make sense that Clang accepts the example since [dcl.spec.auto.general] p3 says
If the function declarator includes a trailing-return-type ([dcl.fct]), that trailing-return-type specifies the declared return type of the function.
This declaration behaves as if it were auto(*)(int).
Suggested resolution
if it is either
- not the auto type-specifier introducing a trailing-return-type(see below), or
- the auto type-specifier introducing the trailing-return-type containing a placeholder type
is a generic parameter type placeholder of the function declaration or lambda-expression.