[clang] [clang-tools-extra] [Clang] Add a builtin that deduplicate types into a pack (PR #106730)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 7 14:00:55 PDT 2025


================
@@ -20,4 +22,10 @@ void expr() {
   static_assert(__is_same(TypePackElement<0, X<0>, X<1>>, X<0>), "");
   static_assert(__is_same(TypePackElement<1, X<0>, X<1>>, X<1>), "");
 #endif
+
+#ifdef DEDUP
+  static_assert(__is_same(TypePackDedup<TypeList>, TypeList<>), "");
+  static_assert(__is_same(TypePackDedup<TypeList, int, double, int>, TypeList<int, double>), "");
----------------
shafik wrote:

I would also like to see `TypePackDedup<TypeList, int, double, int>, TypeList<double, int>)`

and some cases w/ typedefs/aliases. 

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


More information about the cfe-commits mailing list