GCC is wrong. There is already a bug report.
[dcl.type.simple]/2 says:
A type-specifier of the form
typename
opt nested-name-specifieropt template-name is a placeholder for a deduced class type ([dcl.type.class.deduct]).
And [dcl.type.class.deduct]/2 says:
A placeholder for a deduced class type can also be used in the type-specifier-seq in the new-type-id or type-id of a new-expression, as the simple-type-specifier in an explicit type conversion (functional notation) ([expr.type.conv]), or as the type-specifier in the parameter-declaration of a template-parameter. A placeholder for a deduced class type shall not appear in any other context.
Such use is allowed.
[temp.arg]/4 describes the syntax error that a template-id is required but there is no <>
. However here std::greater
is not resolved as a template-id so that paragraph does not apply.