================
@@ -18789,7 +18792,11 @@ static bool captureInLambda(LambdaScopeInfo *LSI, 
ValueDecl *Var,
     //   parameter-declaration-clause is not followed by mutable.
     DeclRefType = CaptureType.getNonReferenceType();
     bool Const = LSI->lambdaCaptureShouldBeConst();
-    if (Const && !CaptureType->isReferenceType())
+    // C++ [dcl.fct]p7:
+    //   [When] adding cv-qualifications on top of the function type [...] the
+    //   cv-qualifiers are ignored.
----------------
cor3ntin wrote:

I think the more relevant wording is 
https://eel.is/c++draft/expr.prim.lambda#capture-10.sentence-4


https://github.com/llvm/llvm-project/pull/118050
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to