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

    <tr>
        <th>Summary</th>
        <td>
            [clang] [Index] The requirements are not handled when generates USR for `TemplateDecl`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          16bit-ykiko
      </td>
    </tr>
</table>

<pre>
    Consider following example:

```cpp
template <typename T, typename U>
struct function;

template <typename T, typename U>
    requires (__is_same(U, int))
struct function<T, U> {
    void foo();
};

template <typename T, typename U>
    requires (__is_same(U, float))
struct function<T, U> {
 void foo();
};
```

The second specialization and third specialization should have different USR, but actually same

```cpp
c:@SP>2#T#T@function>#t0.0#t0.1
c:@SP>2#T#T@function>#t0.0#t0.1
```

Thie is beacuse the `USRGenerator` doesn't handle requirements in `TemplateDecl`. See

https://github.com/llvm/llvm-project/blob/caeefe7b9403a281d5ea3501c3792ba01b3ee7ae/clang/lib/Index/USRGeneration.cpp#L352-L361
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VM1u8zYQfBrqsohBLfV70CG246LAdyhi-xxQ0spiQ5OqSDlxn76gZDcoEhRNgQ9YgRCkGc7sLFY6p06GqGLpmqXbSE6-t2MVZ7XyD9dX9Wqj2rbXamONUy2N0Fmt7ZsyJ6B3eR40MfHI-FwZX6oZBsYfPZ0HLT0BExt_HcjIM8GB4Qb-fjsy8cT4o_Pj1HjoJtN4ZQ0T64XwvzMAAIz0x6RGcsCweHlR7sXJMzEsjgGgjGdYhvrius3MGaiA5esb3cWqFjprGRYBtmjKtz9DXKet_Ja8f9d2j2HReegJHDXWtOAGapTU6k8ZiEGaFnyvxk8fXG8n3UIvLwSt6joayXg47p-DjnryIBs_Sa2vMLv4KvwmTEXC978x8YQMxWF-Ev7h6omh8HzFlyP-n5hPZhWBclCTbCZH4HsClvHj_vkXMjRKb0eWcWgtOcMw99BL02q6x3Mm4x0oEzCHW75bajTL-Ar2dLPaez-4oBV3DHcn5fupXjX2zHCn9eV-PAyj_Z0az3BXa1sz3DWSqKO8LhMuJBZxm5IUKY8bkZdYSx7XgiiXFH7V0pwCkQrAX01L7wx3HzaUNavQaBQ_RIoPP0QWR20l2lKUMqIqzkWRFGWSlVFfYV7yJhZ5IXKepFndYUkJUl7knegSLCJVIceUI0deJgmWq6xseCfbNEkTmfIsZQmns1R6FXyt7HiKlHMTVTGmouSRljVpNy8QxJtyDLtkrOZG1NPJsYRr5bz7oPDK63nrLIh0CyxdL07TLYSp_UcociQw9h5YC289GTgt3SAXhhM6O34RXDSNuvp2ZLNBx3B383ip8K8AAAD__2pLlEs">