diff options
| author | Younan Zhang <zyn7109@gmail.com> | 2024-09-18 16:34:55 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-18 16:34:55 +0800 |
| commit | dd222ff25129f4d67473a9af598a78d0adfcfd29 (patch) | |
| tree | bd828edb593a9ebf0227b3b68e5adaa14d360179 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
| parent | ef34cba1c38870197e2fe2ecd4c8326fc4b98340 (diff) | |
[Clang] Avoid transforming lambdas when rebuilding immediate expressions (#108693)
When rebuilding immediate invocations inside
`RemoveNestedImmediateInvocation()`, we employed a `TreeTransform` to
exercise the traversal. The transformation has a side effect that, for
template specialization types, their default template arguments are
substituted separately, and if any lambdas are present, they will be
transformed into distinct types than those used to instantiate the
templates right before the `consteval` handling.
This resulted in `B::func()` getting redundantly instantiated for the
case in question. Since we're also in an immediate evaluation context,
the body of `foo()` would also get instantiated, so we end up with a
spurious friend redefinition error.
Like what we have done in `ComplexRemove`, this patch also avoids the
lambda's transformation in TemplateInstantiator if we know we're
rebuilding immediate calls. In addition, this patch also consolidates
the default argument substitution logic in
`CheckTemplateArgumentList()`.
Fixes #107175
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions
