================ @@ -13830,61 +13820,27 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) { getSema().AddTemplateParametersToLambdaCallOperator(NewCallOperator, Class, TPL); - // Transform the type of the original lambda's call operator. - // The transformation MUST be done in the CurrentInstantiationScope since - // it introduces a mapping of the original to the newly created - // transformed parameters. - TypeSourceInfo *NewCallOpTSI = nullptr; - { - auto OldCallOpTypeLoc = - E->getCallOperator()->getTypeSourceInfo()->getTypeLoc(); - - auto TransformFunctionProtoTypeLoc = - [this](TypeLocBuilder &TLB, FunctionProtoTypeLoc FPTL) -> QualType { - SmallVector<QualType, 4> ExceptionStorage; - return this->TransformFunctionProtoType( - TLB, FPTL, nullptr, Qualifiers(), - [&](FunctionProtoType::ExceptionSpecInfo &ESI, bool &Changed) { - return TransformExceptionSpec(FPTL.getBeginLoc(), ESI, - ExceptionStorage, Changed); - }); - }; - - QualType NewCallOpType; - TypeLocBuilder NewCallOpTLBuilder; - - if (auto ATL = OldCallOpTypeLoc.getAs<AttributedTypeLoc>()) { - NewCallOpType = this->TransformAttributedType( - NewCallOpTLBuilder, ATL, - [&](TypeLocBuilder &TLB, TypeLoc TL) -> QualType { - return TransformFunctionProtoTypeLoc( - TLB, TL.castAs<FunctionProtoTypeLoc>()); - }); ---------------- zyn0217 wrote:
Oh I see the explanation from the commit: it manages to avoid calling into TemplateInstantiator's `TransformFunctionProtoType()`, which isn't possible if it just delegates to `TransformType()`. Terrible. https://github.com/llvm/llvm-project/pull/85325 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits