You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Varna, EWG decided not to support function parameter names and requires clauses parameter as these can remained unamed without semantics differences.
This design was not worded correctly because [basic.scope.scope] paragraph 5, bullet 1 permits all variables with automatic storage duration named _ to be name-independent, including function parameters.
Suggested resolution
Change [basic.scope.scope] paragraph 5 as follows:
A declaration is name-independent if its name is _ (U+005F LOW LINE) and it declares
a variable with automatic storage duration other than a function parameter,
a structured binding with no storage-class-specifier and not inhabiting a namespace scope,
the variable introduced by an init-capture, or
a non-static data member of other than an anonymous union.
Recommended practice: Implementations should not emit a warning that a name-independent declaration is used or unused.
The text was updated successfully, but these errors were encountered:
jensmaurer
changed the title
[basic.scope.scope] Function parameters can be name-independent
CWG3005 [basic.scope.scope] Function parameters can be name-independent
Mar 11, 2025
Reference (section label): [basic.scope.scope] pargraph 5, bullet 1
Link to reflector thread (if any):
Issue description
From P2169R4:
See also poll: cplusplus/papers#878 (comment)
This design was not worded correctly because [basic.scope.scope] paragraph 5, bullet 1 permits all variables with automatic storage duration named
_
to be name-independent, including function parameters.Suggested resolution
Change [basic.scope.scope] paragraph 5 as follows:
The text was updated successfully, but these errors were encountered: