================ @@ -1736,23 +1736,13 @@ namespace { SourceLocation RParenLoc, std::optional<unsigned> Length, ArrayRef<TemplateArgument> PartialArgs) { - if (SemaRef.CodeSynthesisContexts.back().Kind != - Sema::CodeSynthesisContext::ConstraintNormalization) - return inherited::RebuildSizeOfPackExpr(OperatorLoc, Pack, PackLoc, - RParenLoc, Length, PartialArgs); - -#ifndef NDEBUG - for (auto *Iter = TemplateArgs.begin(); Iter != TemplateArgs.end(); - ++Iter) - for (const TemplateArgument &TA : Iter->Args) - assert(TA.getKind() != TemplateArgument::Pack || TA.pack_size() == 1); -#endif - Sema::ArgumentPackSubstitutionIndexRAII SubstIndex( - SemaRef, /*NewSubstitutionIndex=*/0); - Decl *NewPack = TransformDecl(PackLoc, Pack); - if (!NewPack) - return ExprError(); - + Decl *NewPack = Pack; + if (SemaRef.CodeSynthesisContexts.back().Kind == + Sema::CodeSynthesisContext::ConstraintNormalization) { + NewPack = TransformDecl(PackLoc, Pack); + if (!NewPack) + return ExprError(); + } return inherited::RebuildSizeOfPackExpr(OperatorLoc, cast<NamedDecl>(NewPack), PackLoc, RParenLoc, Length, PartialArgs); ---------------- zyn0217 wrote:
> Can we move this into a Transform* function? Thanks, I didn't realize that convention before. Fixed https://github.com/llvm/llvm-project/pull/115120 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits