alexfh added a comment. In D128113#3744128 <https://reviews.llvm.org/D128113#3744128>, @mizvekov wrote:
> In D128113#3743936 <https://reviews.llvm.org/D128113#3743936>, @alexfh wrote: > >> I wonder what is the practical application of the substitution index in >> SubstTemplateTypeParmType? Diagnostics? Matching AST? Something else? What >> would be the cost of calculating the index when necessary? > > The pack index helps you figure out which argument within an argument pack > was used in a substitution, much like the `ReplacementType` has an index > which helps you figure out which argument was used. > > Calculating it should be possible, if we have the whole type which contains > the pattern from where the expansion came from. > > The problem is that if we want to extract a sub-type from the whole, say the > type of a certain function argument, then we would have to rebuild that type > to include this pack index in any substitution sugar. And that sounds > expensive as well. Do you have a practical example that would use the substitution index? I believe you had something in mind before you implemented this patch? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128113/new/ https://reviews.llvm.org/D128113 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits