================
@@ -15512,6 +15512,8 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr 
*E) {
     DC = DC->getParent();
   if ((getSema().isUnevaluatedContext() ||
        getSema().isConstantEvaluatedContext()) &&
+      !(dyn_cast_or_null<CXXRecordDecl>(DC->getParent()) &&
----------------
erichkeane wrote:

We'd want to use `isa_and_present` (or `isa_and_nonnull` or w/e it is called) 
in this case.

That said, we probably would prefer to do something like extracting above the 
`if` a `const auto *RD = dyn_cast_if_present<CXXRecordDecl>(DC->getParent());`  
then changing the check to RD && RD->isGenericLambda()` (or perhaps BETTER, 
pulling that whole thing out to a separate boolean with a reasonable name, so 
you have a place to put a comment).

Which brings me to the last thing, I'd like a comment explaining WHY this check 
should be here, it looks enough out of place as to why this cannot be dependent.


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

Reply via email to