[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 01:27:55 PDT 2024


================
@@ -2774,6 +2775,41 @@ Expr *transformRequireClause(Sema &SemaRef, FunctionTemplateDecl *FTD,
   return E.getAs<Expr>();
 }
 
+// Build the associated constraints for the alias deduction guides.
+// C++ [over.match.class.deduct]p3.3:
+//   The associated constraints ([temp.constr.decl]) are the conjunction of the
+//   associated constraints of g and a constraint that is satisfied if and only
+//   if the arguments of A are deducible (see below) from the return type.
+Expr *
+buildAssociatedConstraints(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate,
+                           FunctionTemplateDecl *FTD,
+                           llvm::ArrayRef<TemplateArgument> TransformedArgs,
+                           QualType ReturnType) {
+  auto &Context = SemaRef.Context;
----------------
hokein wrote:

Oops,  it looks like I forgot to push one commit.

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


More information about the cfe-commits mailing list