[PATCH] D119544: Deferred Concept Instantiation Implementation
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 20 11:02:38 PDT 2022
erichkeane added inline comments.
================
Comment at: clang/lib/Sema/TreeTransform.h:13002
+ ExprResult NewTrailingRequiresClause =
+ E->getCallOperator()->getTrailingRequiresClause();
----------------
erichkeane wrote:
> cor3ntin wrote:
> > That doesn't look right.
> > At best if you don't transform the trailing return type you wouldn't refer to the transformed captures and that is the issue you are seeing with
> >
> > ```
> > // This asserts because 'y' is not in the Scope's "FindInstantiationOf"
> > [y = x]() requires(constraint<decltype(y)>){}
> > ```
> >
> > But i suspect this should explode even more spectacularly in some cases?
> > If i understand correctly, it shouldn't be checked - but it still be substituted.... or am i missing something?
> >
> >At best if you don't transform the trailing return type you wouldn't refer to the transformed captures and that is the issue you are seeing with
>
> So the point of the patch here is that we cannot transform this until we need to 'check' this constraint. I also missed the 'call' of the lambdas in each of those cases, so it does need to be 'checked', which means it needs to be 'substituted'.
>
> >But i suspect this should explode even more spectacularly in some cases?
> >If i understand correctly, it shouldn't be checked - but it still be substituted.... or am i missing something?
>
> I think it cannot be substituted either, because the type might be different by the time you get to the need to check, see here: https://godbolt.org/z/GxP9T6fa1
Hrm.... i just discovered "RebuildExprInCurrentInstantiation". I wonder if all of these places should be doing THAT instead...
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119544/new/
https://reviews.llvm.org/D119544
More information about the cfe-commits
mailing list