[clang] [clang] Crash when referencing capture in static lambda (PR #74661)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 05:02:36 PST 2023


================
@@ -8492,14 +8492,24 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) {
       return false;
 
     if (auto *FD = Info.CurrentCall->LambdaCaptureFields.lookup(VD)) {
+      auto *MD = cast<CXXMethodDecl>(Info.CurrentCall->Callee);
----------------
tbaederr wrote:

```suggestion
      const auto *MD = cast<CXXMethodDecl>(Info.CurrentCall->Callee);
```

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


More information about the cfe-commits mailing list