Title
Function parameters should never be name-independent
Status
tentatively ready
Section
6.4.1 [basic.scope.scope]
Submitter
Jan Schultke

Created on 2025-03-10.00:00:00 last changed 4 days ago

Messages

Date: 2025-09-13.07:11:44

Proposed resolution (approved by CWG 2025-09-12):

Change in 6.4.1 [basic.scope.scope] bullet 5.1 as follows:

A declaration is name-independent if its name is _ (u+005f low line) and it declares
  • a variable, other than a function parameter, with automatic storage duration,
  • 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.
Date: 2025-03-10.00:00:00

(From submission #681.)

According to P2169R4 (A nice placeholder with no name):

In Varna, EWG decided not to support function parameter names and requires clauses param-eter as these can remained unamed without semantics differences.

However, the normative wording does permit function parameters to be name-independent, contrary to the express design intent.

History
Date User Action Args
2025-09-13 07:11:44adminsetstatus: open -> tentatively ready
2025-03-11 10:46:44adminsetmessages: + msg7986
2025-03-10 00:00:00admincreate