================
@@ -3331,6 +3343,65 @@ checkBuiltinTemplateIdType(Sema &SemaRef,
BuiltinTemplateDecl *BTD,
QualType HasNoTypeMember = Converted[2].getAsType();
return HasNoTypeMember;
}
+ case BTK__builtin_dedup_pack: {
+ assert(Converted.size() == 1 && "__builtin_dedup_pack should be given "
+ "a parameter pack");
+ TemplateArgument Ts = Converted[0];
+ // Delay the computation until we can compute the final result. We choose
+ // not to remove the duplicates upfront before substitution to keep the
code
+ // simple.
+ if (Ts.isDependent())
+ return QualType();
+ assert(Ts.getKind() == clang::TemplateArgument::Pack);
+ llvm::SmallVector<TemplateArgument> OutArgs;
+ llvm::SmallDenseSet<QualType> Seen;
+ // Synthesize a new template argument list, removing duplicates.
+ for (auto T : Ts.getPackAsArray()) {
----------------
erichkeane wrote:
I suspect it is a 'holding it wrong'? Though I probably MEANT to suggest
`SetVector`? Does that make it easier?
https://github.com/llvm/llvm-project/pull/106730
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits