[PATCH] D119609: [Clang][Sema] Don't act on ReturnStmt when parsing the lambda declarator.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 12:57:00 PST 2022


aaron.ballman added a comment.

Thank you for looking into this! I'm not certain this is the correct approach, however. The comment on the function is:

  /// ActOnCapScopeReturnStmt - Utility routine to type-check return statements
  /// for capturing scopes.

however, there's not a capture scope in the test case -- the GNU expression statement is within the parameter list, which can't capture anything: https://godbolt.org/z/3KrEx8hEW. I think the issue might be whatever causes us to call `ActOnCapScopeReturnStmt()`  in the first place.

But there's a design question there as to whether expression statements in a lambda default parameter value makes sense *at all*, because the lambda is an object that can be passed around to others to call. e.g., https://godbolt.org/z/3Edeqv9qv


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119609/new/

https://reviews.llvm.org/D119609



More information about the cfe-commits mailing list