6
Basics
[basic]
6.4
Scope
[basic.scope]
6.4.4
Function parameter scope
[basic.scope.param]
1
#
A
parameter-declaration-clause
P
introduces a
function parameter scope
that includes
P
.
[
Note
1
:
A function parameter cannot be used for its value within the
parameter-declaration-clause
(
[dcl.
fct.
default]
)
.
—
end note
]
(1.1)
If
P
is associated with a
declarator
and is preceded by a (possibly-parenthesized)
noptr-declarator
of the form
declarator-id
attribute-specifier-seq
o
p
t
, its scope extends to the end of the nearest enclosing
init-declarator
,
member-declarator
,
declarator
of a
parameter-declaration
or a
nodeclspec-function-declaration
, or
function-definition
, but does not include the locus of the associated
declarator
.
[
Note
2
:
In this case,
P
declares the parameters of a function (or a function or template parameter declared with function type)
.
A member function's parameter scope is nested within its class's scope
.
—
end note
]
(1.2)
If
P
is associated with a
lambda-declarator
, its scope extends to the end of the
compound-statement
in the
lambda-expression
.
(1.3)
If
P
is associated with a
requirement-parameter-list
, its scope extends to the end of the
requirement-body
of the
requires-expression
.
(1.4)
If
P
is associated with a
deduction-guide
, its scope extends to the end of the
deduction-guide
.