[PATCH] D144192: GH60642: Fix ICE when checking a lambda defined in a concept definition

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 14:29:31 PST 2023


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



More information about the cfe-commits mailing list