================
@@ -2149,24 +2153,28 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation 
StartLoc,
   CleanupInfo LambdaCleanup = LSI->Cleanup;
   bool ContainsUnexpandedParameterPack = LSI->ContainsUnexpandedParameterPack;
   bool IsGenericLambda = Class->isGenericLambda();
+  sema::AnalysisBasedWarnings::Policy WP =
+      AnalysisWarnings.getPolicyInEffectAt(EndLoc);
 
   CallOperator->setLexicalDeclContext(Class);
-  Decl *TemplateOrNonTemplateCallOperatorDecl =
-      CallOperator->getDescribedFunctionTemplate()
-          ? CallOperator->getDescribedFunctionTemplate()
-          : cast<Decl>(CallOperator);
----------------
zyn0217 wrote:

I think you can leave it as-is? That way you can
```cpp
sema::AnalysisBasedWarnings::Policy *ActivePolicy = IsGenericLambda ? nullptr : 
&WP;
Sema::PoppedFunctionScopePtr _ =
      PopFunctionScopeInfo(ActivePolicy, TemplateOrNonTemplateCallOperatorDecl);
```

Though I have no idea why `LSI->CallOperator` doesn't work when it's a template.

https://github.com/llvm/llvm-project/pull/159364
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to