================ @@ -777,12 +844,32 @@ bool Sema::CheckParameterPacksForExpansion( IdentifierInfo *Name; bool IsVarDeclPack = false; FunctionParmPackExpr *BindingPack = nullptr; + std::optional<unsigned> NumPrecomputedArguments; - if (const TemplateTypeParmType *TTP = - ParmPack.first.dyn_cast<const TemplateTypeParmType *>()) { + if (auto *TTP = ParmPack.first.dyn_cast<const TemplateTypeParmType *>()) { Depth = TTP->getDepth(); Index = TTP->getIndex(); Name = TTP->getIdentifier(); + } else if (auto *TST = + ParmPack.first + .dyn_cast<const TemplateSpecializationType *>()) { + assert(isPackProducingBuiltinTemplateName(TST->getTemplateName())); + // Delay expansion, substitution is required to know the size. + ShouldExpand = false; + if (!FailOnPackProducingTemplates) + continue; + + // It is not yet supported in many positions. + Diag(PatternRange.getBegin().isValid() ? PatternRange.getBegin() + : EllipsisLoc, + diag::err_unsupported_builtin_template_pack_position) + << TST->getTemplateName(); + return true; ---------------- ilya-biryukov wrote:
Done. https://github.com/llvm/llvm-project/pull/106730 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits