[clang] [Clang] Add default arguments to the parameter mapping (PR #192071)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 09:54:27 PDT 2026


================
@@ -2105,6 +2105,25 @@ void SubstituteParameterMappings::buildParameterMapping(
       SemaRef.MarkUsedTemplateParameters(Args->arguments(),
                                          /*Depth=*/0, OccurringIndices);
   }
+
+  // If a parameter is only referenced in a default template argument,
+  // we need to add it to the mapping explicitly.
+  {
+    llvm::SmallVector<TemplateArgument> DefaultArgs;
----------------
ojhunt wrote:

Default smallvector holds 4 (or 8? the size of TemplateArgument is obscured in a wall of unions and badly named structs :D) so it's fine in practice - It was more a question of "did you make a conscious choice here, or is it just because the API doesn't exist atm" :D

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


More information about the cfe-commits mailing list