[clang] [Clang] Diagnose unexpanded packs for NTTP type constraints (PR #121296)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 31 01:23:29 PST 2024


================
@@ -857,7 +857,8 @@ class PackDeductionScope {
       if (auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(
               TemplateParams->getParam(Index))) {
         if (!NTTP->isExpandedParameterPack())
-          if (auto *Expansion = dyn_cast<PackExpansionType>(NTTP->getType()))
+          if (auto *Expansion = dyn_cast<PackExpansionType>(
+                  S.Context.getUnconstrainedType(NTTP->getType())))
----------------
zyn0217 wrote:

@cor3ntin I assume we are unable to deduce template arguments in the type constraint, right? This logic would otherwise end up matching the NTTP argument against the NTTP constraint

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


More information about the cfe-commits mailing list