Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syntax] p2 Add "X-expression" in the list #5543

Open
xmh0511 opened this issue Jun 28, 2022 · 0 comments
Open

[syntax] p2 Add "X-expression" in the list #5543

xmh0511 opened this issue Jun 28, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Jun 28, 2022

All grammars defined in [expr] that have the form X-expression are intended to interpret as expressions. And we use the literal word "expression" in another subclause such as [basic.def.odr] to define some rules for these expressions.

extern int b;
int a = b;

b as the grammar component initializer that is an assignment-expression should eventually obey the rule defined for "expression" in [basic.def.odr](i.e. the variable b is odr-used by an expression). In the current draft, we just have a note specifying that X-expression is the syntax of an expression
[expr.pre] p1

[Note 1: [expr] defines the syntax, order of evaluation, and meaning of expressions. An expression is a sequence of operators and operands that specifies a computation. An expression can result in a value and can cause side effects. — end note]

Augment [syntax] p2 to cover the meaning of the note

Names for syntactic categories have generally been chosen according to the following rules:

  • [...]
  • X-expression is an expression with no context-dependent meaning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant