[clang] [clang-tools-extra] [lldb] [clang] Reland: Instantiate alias templates with sugar (PR #101858)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 18:38:42 PDT 2024


zyn0217 wrote:

> or if we would implement a `TypeAliasTemplateSpecializationDecl` only for the benefit of external resugarers.

It is not only valuable to external resugarers. Another point that warrants an introduction of it is for unevaluated lambdas. These lambdas e.g. appearing as part of the `using Alias = decltype(lambda)` could carry a requires expression and thus evaluating it requires the recovery of the instantiating template arguments for the type alias, which isn't a quite natural thing without such a Decl. I have improved some of these situations through an on-stack InstantiatingTemplate to help to inspect the template arguments; however, that approach is somewhat cumbersome and still couldn't extend to other scenarios e.g. mangling these lambdas. (https://github.com/llvm/llvm-project/issues/97024. We need a correct DeclContext for the lambda, yet a `TypeAliasTemplateDecl` isn't a DeclContext, unfortunately.)


https://github.com/llvm/llvm-project/pull/101858


More information about the cfe-commits mailing list