[clang] [clang] Implement CTAD for type alias template. (PR #77890)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 06:14:38 PST 2024


================
@@ -2258,6 +2260,94 @@ class ExtractTypeForDeductionGuide
   }
 };
 
+// Build a deduction guide with the specified parameter types.
+FunctionTemplateDecl *
+buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate,
+                    TemplateParameterList *TemplateParams,
+                    CXXConstructorDecl *Ctor, ExplicitSpecifier ES,
+                    TypeSourceInfo *TInfo, SourceLocation LocStart,
+                    SourceLocation Loc, SourceLocation LocEnd, bool IsImplicit,
+                    llvm::ArrayRef<TypedefNameDecl *> MaterializedTypedefs = {}) {
----------------
hokein wrote:

For a function declaration, e.g. `void func();`, `Loc` points to the `func` token, `LocStart ` points to the `void` token, `LocEnd` points to `)`.

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


More information about the cfe-commits mailing list