USR mangling is not unique
| Bugzilla Link | 13575 |
| Resolution | FIXED |
| Resolved on | Oct 09, 2017 17:40 |
| Version | 3.1 |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @hyp,@DougGregor,@jkorous-apple |
Extended Description
The code snippet below defines two different variants of a template function "dummy". However, for both "dummy" variants "clang_getCursorUSR" returns the same name.
//------snip-----------------------------------------
// some traits template <bool b, typename T> struct RestrictTo {};
template
template <typename T1, typename T2> struct IsSame { static const bool value = false; };
template
// variant1
template
// variant2
template
//------snap-----------------------------------------
r315236, r315241 and rr315255 should fix the remaining issues.
The other problems are still there though.
FYI, the original dummy functions have different USRs now.
I'll aim for next release.
Is there any chance this ever gets fixed?
Is there any chance that this gets fixed some day?
Here's another case in which different types can get the same USR:
typedef void (*FuncPtrA_)(); typedef void (*FuncPtrB_)( int ); typedef FuncPtrA_ (*FuncPtrA)( int ); typedef FuncPtrB_ (*FuncPtrB)(); void Func( FuncPtrA ) {} // c:@F@Func#FFvI# void Func( FuncPtrB ) {} // c:@F@Func#FFvI#
The problem here is that the representation of function pointer types is too terse; there needs to be a terminator after the parameter list to avoid ambiguity.
cloned to rdar://problem/12627498
Here's another case where unique functions don't have unique USRs: when fixed-length arrays are used as template types to specialize a template function. Here's my example:
// c:@FT@>1#Tmystrlwr#&t0.0#
template
As you can see, the template type in this case is 'lost' in the USR, so the three template specializations end up with the same USR.
[discussed on the mailing list in this thread: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-November/025522.html]
This issue was discussed in the mailing list
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-August/023628.html
and identified as a bug by John McCall and Douglas Gregor.
This issue was discussed in the mailing list
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-August/023628.html
and identified as a bug by John McCall and Douglas Gregor.
assigned to @hyp