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

    <tr>
        <th>Summary</th>
        <td>
            Missing diagnostic of declaration use when accessing TypeDecls through typename access
        </td>
    </tr>

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

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

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

<pre>
    Repro: https://godbolt.org/z/TeTzfcdsv
```
struct A {
  using ta [[deprecated]] = int;
};

using t1 = typename A::ta;

template <class B1> struct B {
  using tb = typename B1::ta;
};

template struct B<A>;
```

GCC emits diagnostic for deprecated 'ta' on both uses, clang emits no diagnostics at all.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUk2TmzAM_TXmomkGbIjJwYck7PbUSyd_wIABtwZnsEhn8-srCGmy6c7IH7Ke9Z40Kn39oX6a8-iZ2EOHeA50YfydrPV16R1u_NiSd6V1MqdrU9XhwuKCxXu2jVdb3IDjVCHsgcnD7QVgCnZoATWw7EBWE5OpNJqaZQUZMFGAHZCJ9QeTxeO-7GuGZIHix9kMujewn1WKPeoXNJr-7Cg_oY-V0yHAIWHiDVZthy-0lZ8zz_jX1P-J-kdzz0t09OntAfvcmtv-_XgE01sMUFvdDj6graDxIzzaAoxLYuYS_AClx45UmsD4EagaUnv7PvinDAE0gnZuExmVbLfbdJsksYhqJeqd2OkILTqjftiwlPvE7BsiprSjRktsRAR_OjOAripzA5-oKQVBAmA3-qntHm26gaJpdOplaix2U7mpfE-Oc5f78Y1m7JepkFySMs1FvWd5lsqoU3kl4zyWUguuG9OkUmapSJu0lI2RmovI6dK4oOYh4nzpBPE1ox_QDDU9zQ16ijw1Zw5mRWQVjzlP5iWzJBWbJst4vsvrJk0qI3PJ0tj02rrNrHUe-WhUi-xyagMFnQ0YHkGaLNsOxqySenu9mN_-srLpCTs_qvtrtBSslmr_AhFYDpM">