Date
2020-12-15.00:00:00
Message id
2325

Content

According to 6.4.4 [basic.scope.param] paragraph 1,

In a function declaration, or in any function declarator except the declarator of a function definition (9.6 [dcl.fct.def]), names of parameters (if supplied) have function prototype scope, which terminates at the end of the nearest enclosing function declarator.

Happily, this permits the use of parameter names with decltype in a late-specified return type, because the return type is part of the function's declarator. However, the note in 9.3.4.6 [dcl.fct] paragraph 11 is now inaccurate and should be updated:

[Note: ...If a parameter name is present in a function declaration that is not a definition, it cannot be used outside of the parameter-declaration-clause since it goes out of scope at the end of the function declarator (6.4 [basic.scope]). —end note]