summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorYounan Zhang <zyn7109@gmail.com>2024-09-18 16:34:55 +0800
committerGitHub <noreply@github.com>2024-09-18 16:34:55 +0800
commitdd222ff25129f4d67473a9af598a78d0adfcfd29 (patch)
treebd828edb593a9ebf0227b3b68e5adaa14d360179 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parentef34cba1c38870197e2fe2ecd4c8326fc4b98340 (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