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

    <tr>
        <th>Summary</th>
        <td>
            bogus diagnostic `deduction_guide_bad_trailing_return_type`
        </td>
    </tr>

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

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

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

<pre>
    The following code is passed in gcc and msvc, but clang gives a bogus diagnostic `deduced type 'B<T>' (aka 'A<type-parameter-0-0>') of deduction guide is not written as a specialization of template 'A'`.

The reason is that when clang compares the equality of two Template-kind `TemplateName`, it doesn't seem to consider the `TypeAliasTemplateDecl` case. 

```
template<typename T> struct A {};
A(void) -> A<int>;

template<typename T> using B = A<T>; 

template<typename T> A(T) -> B<T>; 
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU02PmzAQ_TXmMkrkGPLBgUOyaY895R4ZGMCNY1N7yGr76zuGTbdSVXUlBB575s17z0Pt27fqMiB03lr_alwPjW8RTIRRx4gtGAd904B2LdzjoxHqBeqJoLGac3vzwAgaat9PEVqje-cjmQbETrbYTg0D0NuIINT-JPKXi8i_8JLDg77ptHvk3ZSxGnXQdyQMK7mSS5pQJfgOZiAynolMZuHmPMFrMEToQCcCccTGaGt-6jmRqwjvo9WESxMG28m1kGchj8s7iQ6oI2czIA2aEQeGW4Q1_s6EMB0g4I-Joelthn31cHmHXt0Mu8LAz41vrIDD5JEhaD1Gx50JIuIdyDOqi6wgzKipjoUfrdHxCXDGxvI-NDriGv6km2CXZw6f6t7dc9wYkrkQKbBZcATBhu_PIj8tBWzB4eFNmzxdpcRkvHGUnH7m_Ad6imk8TiDy81x9WWrhU8Wp_-V389Pf5U99WVvlbZmXOiNDFqt_jla66Os8Eddat1cK2lgmeA1IU3DX1D7BTcFWA9EYRc4cvvLTGxqmes1XzIG1j-dnNQb_HRvi0MQ4YeTFtihlmQ1Vty9ylR_2elPsu7zutNzJTuU7KfNO6bbMrK7RxkpsT0KpeYa43wdrxlJie85MpaRSstgUm3xTbg_rErdy39WbAtWmUJ0WhcQ7K1knRmsf-ixUM7l66iMfWhMpfhzyP2p6hzg3Znw90eBDNfgbGpfNMqpZwy8Glzp7">