erichkeane added inline comments.

================
Comment at: clang/lib/Sema/TreeTransform.h:4572
                : Sema::ExpressionEvaluationContext::ConstantEvaluated,
-        /*LambdaContextDecl=*/nullptr, /*ExprContext=*/
+        Sema::ReuseLambdaContextDecl, /*ExprContext=*/
         Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
----------------
shafik wrote:
> Not for this PR but I am looking at other place we use 
> `EnterExpressionEvaluationContext` and it is not obvious to me when we should 
> be using `Sema::ReuseLambdaContextDecl` or not. So might be worth looking at 
> other uses as well.
Yeah, its unfortunately not particularly clear to me either. We should be 
re-using that context any time we're going "down" in code (that is, if we are 
potentially in a context where a lambda is defined inside of something its 
actual declcontext doesn't match), but should NOT reuse the context in a case 
where we are 'swapping' contexts to do something like instantiate a function 
required by the current context/etc.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144192/new/

https://reviews.llvm.org/D144192

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to