[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 11:32:21 PDT 2024


================
@@ -2653,20 +2653,34 @@ 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(
-    ArrayRef<NamedDecl *> TemplateParams,
+    const TemplateParameterList* TemplateParamsList,
----------------
mizvekov wrote:

The template parameters themselves should also have a depth, not just the index.
So you don't need to change everything to pass a TemplateParameterList instead of the array as before.

In fact, TemplateParameterList will just return the depth of its first parameter.

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


More information about the cfe-commits mailing list