<div dir="ltr">Hi Richard,<div><br></div><div>Thanks for the suggestion. Yes, I have already retrieved that before the desugaring. I want to access this value after the desugaring. The main issue is after the desugaring it becomes the RecordType, in this type the number of parameters is always the same. </div><div>So, I think, I have to pass this information in the RecordType even after desugaring. What will be the best way to achieve this goal?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 9, 2019 at 12:59 PM Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br></div><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"><div dir="ltr">On Sat, 7 Dec 2019 at 00:12, Awanish Pandey via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div>Thanking You<br></div>Awanish Pandey<br></div>PhD, CSE<br></div>IIT Kanpur<br></div></div></div></div>