[clang] [clang-tools-extra] [clang][NFC] Un-constify `MultiLevelTemplateArgumentList` (PR #104687)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 18 03:44:09 PDT 2024


cor3ntin wrote:

While I agree with you that we should be careful with you that `const_cast` is usually a bad thing,
I am not sure removing const everywhere for one usage is a net-positive. There are no reason for template arguments to ever be modified. 
The forgot/remember exception is somewhat of a hack, and we might want to explore if we can improve _that_

A clean change would be to copy the whole MTAL and replace the "forgotten" argument. That might be worth benchmarking (references to `TemplateArgs` in `TemplateInstantiator` would have to be replaced by a function that return that copy, if any) 

But, I think I am content with the status quo, if we don't find a better option we should probably add comments.







https://github.com/llvm/llvm-project/pull/104687


More information about the cfe-commits mailing list