================
@@ -6369,27 +6451,88 @@ bool 
Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(
   //   be inverted between Ps and As. On non-deduced context, matching needs to
   //   happen both ways, according to [temp.arg.template]p3, but this is
   //   currently implemented as a special case elsewhere.
-  if (::DeduceTemplateArguments(*this, A, AArgs, PArgs, Info, Deduced,
-                                /*NumberOfArgumentsMustMatch=*/false,
-                                IsDeduced ? PackFold::ArgumentToParameter
-                                          : PackFold::ParameterToArgument) !=
-      TemplateDeductionResult::Success)
+  switch (TemplateDeductionResult Result = ::DeduceTemplateArguments(
+              *this, A, AArgs, PArgs, Info, Deduced,
+              /*NumberOfArgumentsMustMatch=*/false,
+              IsDeduced ? PackFold::ArgumentToParameter : PackFold::Both)) {
+  case clang::TemplateDeductionResult::Success:
+    break;
+
+  case TemplateDeductionResult::MiscellaneousDeductionFailure:
+    Diag(AArg->getLocation(), diag::err_template_param_list_different_arity)
+        << (A->size() > P->size()) << /*isTemplateTemplateParameter=*/true
+        << SourceRange(A->getTemplateLoc(), P->getRAngleLoc());
+    return false;
----------------
mizvekov wrote:

The right thing would be to introduce a new enumerator, but I think this patch 
keeps the status quo while being large enough already.

https://github.com/llvm/llvm-project/pull/96023
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to