<div dir="ltr"><div>Hello there, thanks for your time reading this :)</div><div><br></div><div>I am trying to extract the code for a specialized template function, but I have no idea on how to proceed. I know I can use SourceManager to get the original 'pure template' code but I don't know how to access the specialized functions (the SourceLocation for them points to the original function in the AST). My idea is to allow users to write some sugar code like:</div><div><br></div><div></div><div>template <typename T></div><div>T myAdd(T x, T y) {</div><div>  return x + y;<br></div><div>}</div><div><br></div><div>myAdd< double >(5.5, 3.3);</div><div>or<br></div><div>myAdd(1, 2);<br></div><div><br></div><div>and after parsing their source files, generate the specialized functions with a different name in a separated utility file, replacing the occurrences of of use (that's the easy part).<br></div><div>The utility file would look like:</div><div><br></div><div>double _impl_double_myAdd(double x, double y) {</div><div>  return x + y;</div><div>}</div><div><br></div><div>int _impl_int_myAdd(int x, int y) {</div><div>  return x + y;</div><div>}</div><div><br></div><div>and the calls:</div><div><br></div><div>_impl_double_myAdd(5.5, 3.3);</div><div>and</div><div>_impl_int_myAdd(1, 2);</div><div><br></div><div>Can anyone point me in the right direction? I though about just replacing the usage cases of 'T' but that seems really manual and error prone.</div><div>Thanks!<br></div></div>