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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 06:01:11 PDT 2024


================
@@ -6100,6 +6100,17 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceI
                               tok::kw___is_pointer_interconvertible_base_of);
 
     return Self.IsPointerInterconvertibleBaseOf(Lhs, Rhs);
+  }
+  case BTT_IsDeducible: {
+    if (const auto *TSTToBeDeduced =
+            LhsT->getAs<DeducedTemplateSpecializationType>()) {
+      sema::TemplateDeductionInfo Info(KeyLoc);
+      return Self.DeduceTemplateArgumentsFromType(
+                 TSTToBeDeduced->getTemplateName().getAsTemplateDecl(), RhsT,
+                 Info) == TemplateDeductionResult::Success;
+    }
+    // FIXME: emit a diagnostic.
----------------
erichkeane wrote:

I dont think we can leave this as a fixme.

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


More information about the cfe-commits mailing list