[clang] [clang] CTAD alias: Respecte explicit deduction guides defined after the first use of the alias template. (PR #125478)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 05:31:37 PST 2025


================
@@ -1191,13 +1209,10 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
   if (AliasTemplate->isInvalidDecl())
     return;
   auto &Context = SemaRef.Context;
-  // FIXME: if there is an explicit deduction guide after the first use of the
-  // type alias usage, we will not cover this explicit deduction guide. fix this
-  // case.
-  if (hasDeclaredDeductionGuides(
-          Context.DeclarationNames.getCXXDeductionGuideName(AliasTemplate),
-          AliasTemplate->getDeclContext()))
-    return;
+  auto SourceDeductionGuides = getSourceDeductionGuides(
+      Context.DeclarationNames.getCXXDeductionGuideName(AliasTemplate),
+      AliasTemplate->getDeclContext());
+
----------------
hokein wrote:

Moved to right after the `if (!Template)` bailout.

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


More information about the cfe-commits mailing list