Open xmh0511 opened 1 year ago
Related to cplusplus/draft#5406. "Function definition scope" needs to be either defined or eliminated.
The definition is for "odr-usable in a scope". How is the block scope of the lambda an intervening scope for the "n" appearing in the default argument?
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[basic.def.odr] p10
Consider a variant of the example below the rule
Now, both the parameter scope and block scope of the lambda-expression are intervening scopes, so the
n
can appear in the function parameter scope of the lambda? It seems not to be the intent of the rule.Suggested Resolution
This avoids the misreading in the original wording when both the function parameter scope and block scope of the lambda are intervening scopes. This also avoids talking about the intervening scope from different "points"/"contexts" that are needed in the original wording.