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

    <tr>
        <th>Summary</th>
        <td>
            Backport e400c63cc39680538a3726a7736baf6b7844c3a8 to LLVM 16
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            release:backport
      </td>
    </tr>

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

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

<pre>
    Please backport e400c63cc39680538a3726a7736baf6b7844c3a8 to 16.x branch to fix a regression issue.

```
    Revert "[clang] Build UsingType for elaborated type specifiers."
    
    This reverts commit e70ca7b35319a3621f9d9c6475926428f8c5c000 and the
    followup patch "[clang] Fix the location of UsingTypeLoc"
 (ebbeb164c25a40cb6ba9c6b18dce5dcd06c0bb07).
    
    The patch causes an incorrect lookup result:
    
    ```
    namespace ns { struct Foo { };}
    
    using ns::Foo;
    void test() {
      struct Foo {
      } k; // the type of k refers to ns::Foo, rather than the local Foo!
    }
    ```
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU8GOpDYQ_RpzKW3L2GDDgcN0WpwmUhRtcrfLReO0GyPbTGb_PgJNpmdHc1oJGYqyX71X5Wdy9teFaGDtmbWXymxljmmY4438Utnofgx_BDKZwBq8rTEVoIZzVBJR9qrjreyM1EIZraWyZlJWd02D0nRQItTq9Ao2mQXnPZz8KxhIdE2Us48L-Jw3OjF-YfzpbVX87TlCAIA_6YVSASYEa88YzHJl7QXOmw8O_sp-uX7_sRJMMQEFY2MyhRyU_V9eCf3kKeXTfvod8fH1ffYZ0lEgA8b73RcgzdFoK1tZ90YqUU-961E1uu2FakQ3ddgi5xzM4qDM9ECbYgjx322F1RScPzMe_eu-HUJEU3b1cXrwf474oMhER9aSrVWDojUNR6us6VHZunNIrUPHFXJruWaiP30tjN5YoNkyZTAL-AVjSoQFQoy3bYVEeQuFyaevEL6YxGLulFeDBEsGps-QS9qwwBjjETJ9YfK8r1_gbbtUWPJeTj6NMe5b37Mv0TsolAsTHRP9DvdIwqdCHzNMX-DG5BmYGJkYjw4fw48T3CDRRCnvd-9jYfEbJFNmSlBms7wPJcCRrD-w_0nKzw15Dys3SNfL3lQ01Eo3WvRdr6t5cMhtLXqFtZ7aljjngupaTa5D7CZRV34QXEheC1Xzpmn1aXKdcI1wbSNkr2XPGk5348MphJf7KaZrdThmUFzyrgrGUsiHdYVIdPiUyaf_nXpcv0uVhv3wN7tdM2t48LnkB1zxJdBw_hVvPz___TvUqtpSGOZS1qO_xwyuvsybPWG8MzHupd5e39YU_yEsTIyHjMzEeCj5LwAA__9tgk-T">