diff options
author | Corentin Jabot <corentinjabot@gmail.com> | 2023-08-29 19:53:19 +0200 |
---|---|---|
committer | Corentin Jabot <corentinjabot@gmail.com> | 2023-09-06 21:59:45 +0200 |
commit | eaf725bc9371a6699902d67d97662caaa3332799 (patch) | |
tree | 9c0e327f243d02dd56399403677b2d0378658b96 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | c47321524c8b45ceaed131410d60898ea9f204f9 (diff) | |
download | llvm-eaf725bc9371a6699902d67d97662caaa3332799.zip llvm-eaf725bc9371a6699902d67d97662caaa3332799.tar.gz llvm-eaf725bc9371a6699902d67d97662caaa3332799.tar.bz2 |
[Clang] Add captures to the instantiation scope of lambda call operators
Like concepts checking, a trailing return type of a lambda
in a dependent context may refer to captures in which case
they may need to be rebuilt, so the map of local decl
should include captures.
This patch reveal a pre-existing issue.
`this` is always recomputed by TreeTransform.
`*this` (like all captures) only become `const`
after the parameter list.
However, if try to recompute the value of `this` (in a parameter)
during template instantiation while determining the type of the call operator,
we will determine it to be const (unless the lambda is mutable).
There is no good way to know at that point that we are in a parameter
or not, the easiest/best solution is to transform the type of this.
Note that doing so break a handful of HLSL tests.
So this is a prototype at this point.
Fixes #65067
Fixes #63675
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D159126
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions