[clang] [clang] CTAD: build aggregate deduction guides for alias templates. (PR #85904)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 07:20:43 PDT 2024


================
@@ -2792,6 +2811,24 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
   } else {
     assert(false && "unhandled RHS type of the alias");
   }
+  return {Template, AliasRhsTemplateArgs};
+}
+
+// Build deduction guides for a type alias template.
+void DeclareImplicitDeductionGuidesForTypeAlias(
+    Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate, SourceLocation Loc) {
+  if (AliasTemplate->isInvalidDecl())
+    return;
+  auto &Context = SemaRef.Context;
+  // FIXME: if there is an explicit deduction guide after the first use of the
----------------
erichkeane wrote:

WOULD we remove said diagnostic?  It seems that:
`If there are some explicit deduction guides after the first usage, they are not covered and are not added to the overload candidate sets.`

means that adding an explicit deduction guide after first use effectively 'does nothing'.  

That said, I'm ok having us do it (or whatever we do next) in a followup patch.

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


More information about the cfe-commits mailing list