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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to