[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 11 10:47:39 PDT 2025
================
@@ -1510,6 +1517,21 @@ namespace {
}
}
+ MultiLevelTemplateArgumentList ForgetSubstitution() {
+ MultiLevelTemplateArgumentList New;
+ New.addOuterRetainedLevels(this->TemplateArgs.getNumLevels());
+
+ MultiLevelTemplateArgumentList Old =
+ const_cast<MultiLevelTemplateArgumentList &>(this->TemplateArgs);
----------------
ilya-biryukov wrote:
Unfortunately yes, but it's the same as in `ForgetPartiallySubstitutedPack/RememberPartiallySubstitutedPack`.
`this->TemplateArgs` is a const reference, and it's probably even good to have some protection against changing it accidentally in **most** places, except these two functions.
We might want to change this, but it's not a pattern that this change adds and so I'd keep this separate from the PR.
https://github.com/llvm/llvm-project/pull/106730
More information about the cfe-commits
mailing list