[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 21:11:52 PDT 2024


================
@@ -944,12 +950,63 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate) {
   return {Template, AliasRhsTemplateArgs};
 }
 
+// Build the type for a deduction guide generated from an inherited constructor
+// [over.match.class.deduct]p1.10:
+// ... the set contains the guides of A with the return type R
+// of each guide replaced with `typename CC<R>::type` ...
+std::pair<TypeSourceInfo *, QualType>
+buildInheritedConstructorDeductionGuideType(
+    Sema &SemaRef, TypeSourceInfo *DerivedClassMapperType,
+    TemplateDecl *DeducingTemplate, TypeSourceInfo *SourceGuideTSI) {
----------------
antangelo wrote:

It is the template we are building the deduction guide for, i.e. the derived class template. I have renamed it to `DerivedClassTemplate` in the context of inherited constructors and `DeducedTemplate` otherwise (to match the naming of `CXXDeductionGuideDecl::getDeducedTemplate()`) to make it a bit more clear.

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


More information about the cfe-commits mailing list