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

    <tr>
        <th>Summary</th>
        <td>
            [clangd] Issues with `Expand auto type` h
        </td>
    </tr>

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

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

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

<pre>
    This refactoring has 2 issues, reproducible via the following code snipped:

```
auto val = std::any_cast<type>(f);
``` 

is expanded to 

```
remove_cv_t<type> val = std::any_cast<type>(f);
```

Which is first wrong, since remove_cv_t is not part of the global namespace.
Also, it is most likely wanted, to expand it to `type`.

Since there are cases, where a programmer does not want the leaf of all alias expansions, I propose, to list all type-id's.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk0FvnD4QxT-NuYyCwF4gHDgk2ayU8_8v9RgN9gBujY1ss9v99pW9G3XVQy-VEAiYefPj8QZD0LMlGljzyppjgXtcnB9ONI5UjE5dh_8XHcDThDI6r-0MCwbgoEPYKTD-Bp4279Qu9WgIzhohLgSTM8ZdUrl0iiBYvW2kmHhh1ZFVX-e2uh_5Fvfo4IwGmDhCiLlavKC9fkoMkYm3eN2IiXfGnyfGeyZe_5CBR3EdgH5uaBUpiA7-MtfT6s70Kc-fD0P-CeRx2LdFywV0gEn7EOHinZ2TbUFbSfAwO9VYF2FDH8FN2cbZuBENWFwpbCipvGm-mOCShs5NqwsRjP5B5goXtJFUehfd_ftTVTKgrTJ2W5WPeP9ljLiQJ0BPIDHcfuvl9gg272aP60oelKMbYpqS-QzhlFjRGECj8e550M5mkY_UvrlAdyKjQ8zFCeVJK8a7UBZqEKoXPRY01G33LLqurutiGXr13IlD33VdL3CkdqqnXon-wFUzjThSoQdecVGJqq-bpm7qsju0SDiNTdVJktPIDhWtqE1pzHktnZ-LnNuhrXnfFQZHMiFHn3NLl1uoGedpE_yQep7GfQ7sUCXw8Fsl6mjyzkiDdlasOcJHXgi46Lgkr99v3udM332Hpdi9GZYYt5AixU-Mn2Ydl30spVsZPyX9--Vp8-47ycj46WvVTpn6VwAAAP__KeAohw">