[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 13:30:34 PDT 2024


================
@@ -2803,7 +2803,207 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate) {
   return {Template, AliasRhsTemplateArgs};
 }
 
-// Build deduction guides for a type alias template.
+// Build deduction guides for a type alias template from the given underlying
+// deduction guide F.
+FunctionTemplateDecl *
+BuildDeductionGuideForTypeAlias(Sema &SemaRef,
----------------
hokein wrote:

We just move the implementation from `DeclareImplicitDeductionGuidesForTypeAlias ` to a dedicated function, so that we can reuse it in the `DeclareAggregateDeductionGuideForTypeAlias`.

The functional change of this commit is in `DeclareAggregateDeductionGuideForTypeAlias`, the previous implementation is incorrect, and we should use the one in `DeclareImplicitDeductionGuidesForTypeAlias`.

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


More information about the cfe-commits mailing list