<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65024>65024</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang USR collision when dealing with template specializations
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          angryzor
      </td>
    </tr>
</table>

<pre>
    The declarations of the types of the variables `x` and `y` in the following code are assigned the same USR `c:@S@A>#$@S@C@S@B` even though they refer to different types:

```cpp
class C {
public:
    class B {};
};

template<class T>
class A {
public:
    class B {};
};

A<C>::B x;
A<C::B> y;
```

This may be normal, but I thought USR's were to supposed to be unique?

The origin of this collision is the lack of a terminator on the template specialization argument list making it ambiguous whether the next qualifier fragment is part of the template parameter or of the specialized class itself.

Suggestion for a fix: add a terminating character at the end of the argument list, e.g. `<`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM1y4ygQfhp06RqXBLIcH3SwnXHVXjfZB2hBS2IHgQZQHOfpt0C2kxz2NlUugfvn67-vwRD0YIlatj2y7XOBSxydb9EO_vrhfNE5dW1fRwJF0qDHqJ0N4HqII0G8zvT484ZeY2coAGvKd9aUgFal-zXdtc1GvTPGXbQdQDpFgJ7gloHK-oATwT8vfyc_ycSB1eULq8sDEz8ZF4zXN8Hpdh4TNr1RQnfLMCaQK3jqyUN0oHTfkycb11QTYPnMyvu3KdefnOdVIg2GACdgu-MqmJfOaPnwAwBYbY7ZZvfMxM3y2z1_I02zwUhMnFaf11TFlziHPxPnwMTplKDFgYnDEd4f-psmi5n4CddPz3vpX4FeRx1gwit0BNb5CQ3jJ-iWCH_d2hvTbBjfBbiQp9ThsMyzC2l6LrktVv9eiInzd1wC5_Wg7coVHUA6Y3TQzoIOefAG5a-kRYjkJ20xOg9uJc29kRBmkhqN_sg0BPTDMqXhGh0iTPgr8UpHwKnTw-KWAJeR4pioMBJYeo_we0Gje00eeo9DdtYBZvTxwel7sBk9ThTJQ8pkVT4SIHWbj46BTL_5Wu7LMgwUcoa984DQ63cmDoBKfSkv78CIHmUKgTHjk1X3UN-KS3OgzbBJa8HEiTXlplCtUHuxx4LaqtmLalvVT1UxtnuOSqpONljVTf20azivaqFqJanCRjWFbnnJRfnEd9V2W_Fq0_RyV_O92O9wz_dKsrqkCbXZGPM2bZwfCh3CQm2zLXldGOzIhPxecG7pAlnJOE_Ph2-Tz49uGQKry5R6-ESJOhpqTwbtkHf8kwSXkSwoQpO6ctFx_L-Zh2Lxph1jnPMy8zPj50HHcek20k2Mn1Ow2_Fj9u5fkpHxc04xMH7OJfwXAAD__x_Yjcs">