[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 08:15:43 PST 2024


cor3ntin wrote:

Thanks for the patch!

Requires Expressions should be in an unevaluated context, so we should never try to capture variables they mentioned.

Maybe we need to test the evaluation context in either `tryCaptureVariable` or `NeedToCaptureVariable`, rather than a specific handling for requires expressions

https://eel.is/c++draft/expr.prim.lambda.capture#7.sentence-2

WDYT?

@erichkeane 

https://github.com/llvm/llvm-project/pull/78598


More information about the cfe-commits mailing list