Otherwise (auto appearing with no type specifiers
other than cv-qualifiers), the auto type-specifier
signifies that the type of an object being declared shall be deduced from
its initializer or specified explicitly at the end of a function
declarator. The name of the object being declared shall not
appear in the initializer expression.
auto can appear with a function declarator with a late-specified return type (8.3.5) in any context where such a declarator is valid, and the use of auto is replaced by the late-specified return type.
Otherwise, the type of the object is deduced from its initializer. The name of the object being declared shall not appear in the initializer expression. This use of auto is allowed when declaring objects in a block (6.3), in namespace scope (3.3.5), and in a for-init-statement (6.5.3). [...]
direct-declarator: declarator-id direct-declarator ( parameter-declaration-clause ) cv-qualifier-seqopt ref-qualifieropt exception-specificationopt direct-declarator ( parameter-declaration-clause ) cv-qualifier-seqopt ref-qualifieropt exception-specificationopt -> type-id direct-declarator [ constant-expressionopt ] ( declarator )
direct-abstract-declarator: direct-abstract-declaratoropt ( parameter-declaration-clause ) cv-qualifier-seqopt ref-qualifieropt exception-specificationopt ( parameter-declaration-clause ) cv-qualifier-seqopt ref-qualifieropt exception-specificationopt -> type-id direct-abstract-declaratoropt [ constant-expressionopt ] ( abstract-declarator )
In a declaration T D where D has the form
and the type of the contained declarator-id in the declaration T D1 is "derived-declarator-type-list T," the type of the declarator-id in D is "derived-declarator-type-list function of (parameter-declaration-clause) cv-qualifier-seqopt returning T"D1 ( parameter-declaration-clause ) cv-qualifier-seqopt exception-specificationopt
In a declaration T D where D has the form
and the type of the contained declarator-id in the declaration
T D1 is "derived-declarator-type-list T,"
obtain P from T by replacing auto with
the type-id. Then the type of the declarator-id
in D is "derived-declarator-type-list function of
(parameter-declaration-clause)
cv-qualifier-seqopt returning
P". auto shall occur exactly once in T.
The type-id is a late-specified return type.
D1 ( parameter-declaration-clause ) cv-qualifier-seqopt exception-specificationopt -> type-id
A type of either form is a function type*.
[Footnote: As indicated by the syntax, cv-qualifiers are a significant component in function return types. --- end foonote]