clang_getCursorDisplayName bug?

Hi,

It appears that the ‘display’ names produced by clang_getCursorDisplayName are not specific enough for function template specializations; that is, the template parameters reduce to ‘<>’. The display names of all specializations of a given function template are identical and thus ambiguous.

The same problem occurs for class methods, however the display names of template class specializations are correct. The display name for an unspecialized template class is still not ideal though; for example “template class myclass” yields the display name “myclass” which does not make it clear whether ‘T’ is a generic typename or a specific type named ‘T’! In this case, “myclass” might be better.

I thought I’d post here before submitting the above as a bug, in case I’m missing something.

Thanks!

iestyn Bleasdale-Shepherd

Hi,

It appears that the ‘display’ names produced by clang_getCursorDisplayName are not specific enough for function template specializations; that is, the template parameters reduce to ‘<>’. The display names of all specializations of a given function template are identical and thus ambiguous.

That does not seem right, please file a bug.

The same problem occurs for class methods, however the display names of template class specializations are correct. The display name for an unspecialized template class is still not ideal though; for example “template class myclass” yields the display name “myclass” which does not make it clear whether ‘T’ is a generic typename or a specific type named ‘T’! In this case, “myclass” might be better.

Not sure about that, the display name is only to provide a user-friendly string, it’s not supposed to provide unique and unambiguous identifiers.
I can see benefits either way, e.g. the shorter “myclass” looks better to me, adding ‘typename’ to each parameter will make the display name a bit too long and unwieldy.