HerrCai0907 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
We will use `tryCaptureVariable` to diagnose `-Wunused-lambda-capture`. So simply ignoring them in an unevaluated context is not a good idea. I have changed the PR to match this function work even for `RequiresExprBodyDecl`. https://github.com/llvm/llvm-project/pull/78598 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits