<br><br><div class="gmail_quote">On Wed, Nov 30, 2011 at 9:03 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Nov 30, 2011 at 8:45 PM, Joerg Sonnenberger<br>
<<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>> wrote:<br>
> On Wed, Nov 30, 2011 at 06:21:04PM -0800, Kostya Serebryany wrote:<br>
>> #include <stdio.h><br>
>> template<class T><br>
>> const char *foo() {<br>
>> return __PRETTY_FUNCTION__;<br>
>> }<br>
>> int main() {<br>
>> printf("%s\n", foo<int>());<br>
>> }<br>
><br>
> This gets more interesting if the template is actually used by the<br>
> function. Changing it to foo(T x) and adjusting the call, the result is:<br>
><br>
> clang:<br>
> const char *foo(int)<br>
><br>
> gcc:<br>
> const char* foo(T) [with T = int]<br>
><br>
> I don't think the GCC output is really better.<br>
<br>
</div>It's worth noting that clang's output is actually ambiguous in some<br>
cases at the moment: you can't tell the difference between "void<br>
f(int)" and "template<typename T> void f(T)" with T=int.</blockquote><div><br></div><div>I think Clang's output should be improved... and I'll actually be glad if it doesn't match the GCC output just so that people are slightly less likely to try parsing this stuff... madness... ;] </div>
</div>