<div dir="ltr"><p>Hello !<br></p><p>I'm writing a small software to translate header into C++ files.
It works fine for non-template class but I'm having n issue with
template class, especially with template class's constructor or
destructor.</p>
<p>I'm using <code>CXXMethodDecl::getNameAsString</code> to get the name of the function.
For a non template class like <br></p><pre><code><span> </span><span>struct</span><span> C
</span><span>{</span><span>
C</span><span>();</span><span>
</span><span>~</span><span>C</span><span>();</span><span>
</span><span>//other stuff</span><span>
</span><span>}</span></code></pre>
<p>The previous function gives me (as I expect) <code>C</code> and <code>~C</code>.</p>
<p>But if the class is template like the following:</p>
<pre><code><span> </span><span>template</span><span> </span><span><</span><span>class</span><span> TT</span><span>,</span><span>int</span><span> N</span><span>></span><span>
</span><span>struct</span><span> C
</span><span>{</span><span>
C</span><span>();</span><span>
</span><span>~</span><span>C</span><span>();</span><span>
</span><span>}</span></code></pre>
<p>I get as result : <code>C<TT, N></code> and <code>~C<TT, N></code>,
which is not what I was expecting. <br></p><p>For me, the name of a function should not be independent of the class
being template. Classic functions behave the way I expect (same name in
both cases).</p><p><br></p>
<p>Am I missing something ? Is this the normal behavior or a bug ?</p><p>Thank you !</p></div>