================ @@ -5635,123 +5627,95 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, assert(Proto1 && Proto2 && "Function templates must have prototypes"); TemplateParameterList *TemplateParams = FT2->getTemplateParameters(); - SmallVector<DeducedTemplateArgument, 4> Deduced; - Deduced.resize(TemplateParams->size()); + SmallVector<DeducedTemplateArgument, 4> Deduced(TemplateParams->size()); - // C++0x [temp.deduct.partial]p3: - // The types used to determine the ordering depend on the context in which - // the partial ordering is done: TemplateDeductionInfo Info(Loc); - switch (TPOC) { - case TPOC_Call: { - llvm::SmallBitVector HasDeducedParam(Args2.size()); - if (DeduceTemplateArguments( - S, TemplateParams, Args2.data(), Args2.size(), Args1.data(), - Args1.size(), Info, Deduced, TDF_None, /*PartialOrdering=*/true, - /*HasDeducedAnyParam=*/nullptr, - &HasDeducedParam) != TemplateDeductionResult::Success) - return false; + if (TPOC == TPOC_Other) { + // We wouldn't be partial ordering these candidates if these didn't match. + assert(Proto2->getMethodQuals() == Proto1->getMethodQuals()); + assert(Proto2->getRefQualifier() == Proto1->getRefQualifier()); + assert(Proto2->isVariadic() == Proto1->isVariadic()); ---------------- cor3ntin wrote:
You could merge all these asserts and maybe add a message like "cannot partial order functions templates with different qualifiers while resolving their address" https://github.com/llvm/llvm-project/pull/106829 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits