The unclear definition for "variable" #4749
Labels
cwg
Issue must be reviewed by CWG.
not-editorial
Issue is not deemed editorial; the editorial issue is kept open for tracking.
As @opensdh answered in this https://stackoverflow.com/questions/65319283/how-to-understand-the-concept-of-variable issue, the definition of the variable is unclear and generally confused by the standard. Also, @languagelawyer did some efforts on clarifying it.
I think the essence of this issue is that we use the declaration with a general meaning. In other words, the declaration may refer to declaration defined in [dcl.dcl] or member-declaration in [class.mem], or parameter-declaration in [dcl.fct], or so on, as long as it is a declaration with the meaning in English.
Why don't we use the defined grammar to eliminate these ambiguous things? Although, use the wording "declaration" is a convenient way to define some rules, sometimes it could result in some ambiguities as the question discussed in the above issue. Maybe, the definition for variable could be that
These italic wordings all refer to the corresponding grammar. It would be a clear(strict) definition.
Or, if the first approach looks too long, we may define what is a declaration of an object. More precisely, which declarations create objects?
@jensmaurer @opensdh @languagelawyer @jwakely
The text was updated successfully, but these errors were encountered: