Hi,
I'm having another look at this old bug, and I think it should be easy
to fix, but there are a few details which I do not understand.
Essentially the issue is about:
struct B
{
template <typename T>
void fn() { cout << __PRETTY_FUNCTION__ << endl; }
};
int main()
{
B().fn<int>();
}
which outputs:
void B::fn() [with T = int]
whereas submitter expected:
void B::fn<T>() [with T = int]
The request makes sense to me, if only because otherwise it's mysterious
where the T between square bracket is coming from. Submitter also
noticed that ultimately the issue is due to the DECL_FRIEND_PSEUDO_*
check in the conditional at the end of dump_function_name:
if (DECL_TEMPLATE_INFO (t)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)
&& (TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
|| PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))))
dump_template_parms (pp, DECL_TEMPLATE_INFO (t), !DECL_USE_TEMPLATE
(t),
flags);
Yesterday I double checked that indeed removing it still fixes the issue
modulo trivial regressions (a few existing testcases need consistent
adjustments). Still, there are details which I'm missing (eg, the name
of the macro seems weird to me: it mentions friends (and friends are
mentioned in its comment too) but isn't used only for DECL_FRIEND_P true
and indeed it is true for the non-friend 'fn' in the snippet at issue).
For sure so far I haven't been able to find cases where removing the
check leads to a wrong error message...
Thanks!
Paolo.