[basic.pre]/3:
A name is an identifier ([lex.name]), conversion-function-id ([class.conv.fct]), operator-function-id ([over.oper]), or literal-operator-id ([over.literal]).
I believe the definition for name includes identifier within label ([stmt.label]):
label:
attribute-specifier-seqopt identifier :
However, [basic.pre]/5 states that:
Every name is introduced by a declaration <...>
Which is at odds with the fact that labels fit into the definition of name, but are statements, and not declarations.
P1787R6 "Declarations and where to find them" made major changes to the definition of name with the following intent:
Because labels interact with so little of the language, their identifiers are excluded from names and name lookup entirely.
It seems that the definition of name should be updated to make it clear that labels are not included.
Suggested resolution (2025-02-20):
Convert [basic.pre] paragraph 3 into a bulleted list, and apply the following changes:
A name is
[basic.pre]/3:
I believe the definition for name includes
identifierwithinlabel([stmt.label]):However, [basic.pre]/5 states that:
Which is at odds with the fact that labels fit into the definition of
name, but are statements, and not declarations.P1787R6 "Declarations and where to find them" made major changes to the definition of name with the following intent:
It seems that the definition of name should be updated to make it clear that labels are not included.
Suggested resolution (2025-02-20):
Convert [basic.pre] paragraph 3 into a bulleted list, and apply the following changes: