[clang] Improve error message for invalid lambda captures (PR #94865)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 11:21:59 PDT 2024


================
@@ -1246,7 +1246,12 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro,
 
       if (auto *BD = R.getAsSingle<BindingDecl>())
         Var = BD;
-      else
+      else if (auto *FD = R.getAsSingle<FieldDecl>()) {
+        Var = R.getAsSingle<VarDecl>();
----------------
Sirraide wrote:

To clarify since Github’s formatting is a bit jank here, I’m talking about the `Var = R.getAsSingle<VarDecl>();` part

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


More information about the cfe-commits mailing list