<div dir="ltr"><div dir="ltr">On Sat, 7 Dec 2019 at 00:12, Awanish Pandey via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear all,<div><br></div><div>I want to access the number of parameters given to a template class during object creation in <i>collectTemplateParams</i>() ( in CGDebugInfo.cpp). </div><div><br></div><div>Ex</div><div>foo<int,>        a; // I want 1<br></div><div>foo<int,char> b; // I want 2</div><div>assuming <i>foo</i> is template class and its default parameters are <<i>char,char</i>></div><div><br></div><div>In 

<i>collectTemplateParams</i>(), I can find actual number of parameters, which is after desugaring the <i>templateSpecialization</i> type.</div><div><br></div><div>Is there any way that can give me the parameters count?</div></div></blockquote><div><br></div><div>You're looking for the number of template arguments, not the number of template parameters. You can find that by looking at TemplateSpecializationType::getNumArgs() (prior to desugaring, which will remove the difference between the types of a and b).</div></div></div>