================ @@ -1446,6 +1447,59 @@ namespace { return inherited::TransformFunctionProtoType(TLB, TL); } + QualType TransformInjectedClassNameType(TypeLocBuilder &TLB, + InjectedClassNameTypeLoc TL) { + auto Type = inherited::TransformInjectedClassNameType(TLB, TL); + // Special case for transforming a deduction guide, we return a + // transformed TemplateSpecializationType. + if (Type.isNull() && + SemaRef.CodeSynthesisContexts.back().Kind == + Sema::CodeSynthesisContext::BuildingDeductionGuides) { + // Return a TemplateSpecializationType for transforming a deduction + // guide. + if (auto *ICT = TL.getType()->getAs<InjectedClassNameType>()) { + auto Type = + inherited::TransformType(ICT->getInjectedSpecializationType()); + TLB.pushTrivial(SemaRef.Context, Type, TL.getNameLoc()); + return Type; + } + } + return Type; + } + // Override the default version to handle a rewrite-template-arg-pack case + // for building a deduction guide. + bool TransformTemplateArgument(const TemplateArgumentLoc &Input, + TemplateArgumentLoc &Output, + bool Uneval = false) { + const TemplateArgument &Arg = Input.getArgument(); + std::vector<TemplateArgument> TArgs; + switch (Arg.getKind()) { + case TemplateArgument::Pack: + // Iterially rewrite the template argument pack, instead of unpacking ---------------- hokein wrote:
this is a typo here, I mean `literally`. https://github.com/llvm/llvm-project/pull/77890 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits