[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 05:01:49 PDT 2024


================
@@ -634,7 +634,7 @@ struct ConvertConstructorToDeductionGuideTransform {
 
 // Find all template parameters that appear in the given DeducedArgs.
 // Return the indices of the template parameters in the TemplateParams.
-SmallVector<unsigned> TemplateParamsReferencedInTemplateArgumentList(
+llvm::SmallSet<unsigned, 8> TemplateParamsReferencedInTemplateArgumentList(
----------------
hokein wrote:

The returned vector is a sorted indices of the referenced template parameters, and the call site implicitly [depends on](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplateDeductionGuide.cpp#L1050-L1051) this order. Changing it could disrupt the indexing of transformed template parameters.

How about keeping it unchanged and creating a SmallSet based on the return result for your use case?

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


More information about the cfe-commits mailing list