[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 02:05:19 PDT 2025


cor3ntin wrote:

This should work
```diff
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index f02a295220ef..6b423ce06523 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -5669,7 +5669,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
   };
   Function->setDeclarationNameLoc(NameLocPointsToPattern());
 
-  EnterExpressionEvaluationContext EvalContext(
+  EnterExpressionEvaluationContextForFunction EvalContext(
       *this, Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
 
   Qualifiers ThisTypeQuals;
```


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


More information about the cfe-commits mailing list