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

simplify lambda-expression grammar #2870

Closed
zygoloid opened this issue May 5, 2019 · 0 comments · Fixed by #2874
Closed

simplify lambda-expression grammar #2870

zygoloid opened this issue May 5, 2019 · 0 comments · Fixed by #2874
Assignees

Comments

@zygoloid
Copy link
Member

zygoloid commented May 5, 2019

(As raised on the core reflector.)

We can simplify the lambda-expression grammar by

  • moving the requires-clause[opt] following the lambda-declarator into the lambda-declarator production,
  • making the lambda-declarator optional, and
  • deleting the (now-redundant) productions that do not contain an optional lambda-declarator

(We could reduce to a single production by moving the template parameter list to its own production, but it's unclear that that's worthwhile.) That should leave:

lambda-expression:
    lambda-introducer lambda-declarator[opt] compound-statement
    lambda-introducer < template-parameter-list > requires-clause[opt] lambda-declarator[opt] compound-statement

lambda-declarator:
    ( parameter-declaration-clause ) decl-specifier-seq[opt] noexcept-specifier[opt]
attribute-specifier-seq[opt] trailing-return-type[opt] requires-clause[opt]

We will also need to update [expr.prim.lambda.closure]/3, changing "the requires-clause following the lambda-declarator" to "the requires-clause of the lambda-declarator".

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

Successfully merging a pull request may close this issue.

2 participants