<div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">Try this:</div><div dir="ltr"><br></div><div dir="ltr"><font face="courier new, monospace">std::string getTypeName(QualType QT) {<br></font></div>
<div dir="ltr"><div dir="ltr"><font face="courier new, monospace"> std::string TypeName;</font></div><div dir="ltr"><font face="courier new, monospace"> llvm::raw_string_ostream TypeNameOS(TypeName);</font></div><div dir="ltr">
<font face="courier new, monospace"> LangOptions LO;</font></div><div dir="ltr"><font face="courier new, monospace"> QT.print(TypeNameOS, PrintingPolicy(LO), "identifier");</font></div><div dir="ltr"><font face="courier new, monospace"> TypeNameOS.flush();</font></div>
<div dir="ltr"><font face="courier new, monospace"> return TypeName;</font></div><div dir="ltr"><font face="courier new, monospace">}</font></div><div dir="ltr"><br></div><div>Yaron</div><div><br></div><div dir="ltr"><br>
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2014-08-05 17:53 GMT+03:00 Manasij Mukherjee <span dir="ltr"><<a href="mailto:manasij7479@gmail.com" target="_blank">manasij7479@gmail.com</a>></span>:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div>For the following code: <br>template <typename T><br>class A {<br> <br>
};<br>
class B {};<br><br>typedef A<B> C;<br></div><div> <br></div><div>I need to access this 'B' template argument, as a Type pointer, maybe.<br>
</div><div>(Ultimately, I only need its name as a string)<br><br></div><div>Can anyone point me to the right way to get this information ?<br><br></div><div>I can get a QualType for A<B> with the getTypeSourceInfo()->getType()<br>
</div><div>functions.<br></div><div>But what to do after that, I can not figure out.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Manasij Mukherjee<br>
</div></font></span></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>