[all-commits] [llvm/llvm-project] b412ec: [Clang][Sema] Revisit the fix for the lambda withi...
Younan Zhang via All-commits
all-commits at lists.llvm.org
Mon Aug 26 18:26:15 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b412ec5d3924c7570c2c96106f95a92403a4e09b
https://github.com/llvm/llvm-project/commit/b412ec5d3924c7570c2c96106f95a92403a4e09b
Author: Younan Zhang <zyn7109 at gmail.com>
Date: 2024-08-27 (Tue, 27 Aug 2024)
Changed paths:
M clang/lib/Sema/SemaTemplateInstantiate.cpp
M clang/test/SemaTemplate/alias-template-with-lambdas.cpp
Log Message:
-----------
[Clang][Sema] Revisit the fix for the lambda within a type alias template decl (#89934)
In the last patch #82310, we used template depths to tell if such alias
decls contain lambdas, which is wrong because the lambda can also appear
as a part of the default argument, and that would make
`getTemplateInstantiationArgs` provide extra template arguments in
undesired contexts. This leads to issue #89853.
Moreover, our approach
for https://github.com/llvm/llvm-project/issues/82104 was sadly wrong.
We tried to teach `DeduceReturnType` to consider alias template
arguments; however, giving these arguments in the context where they
should have been substituted in a `TransformCallExpr` call is never
correct.
This patch addresses such problems by using a `RecursiveASTVisitor` to
check if the lambda is contained by an alias `Decl`, as well as
twiddling the lambda dependencies - we should also build a dependent
lambda expression if the surrounding alias template arguments were
dependent.
Fixes #89853
Fixes #102760
Fixes #105885
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list