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

    <tr>
        <th>Summary</th>
        <td>
            assume_aligned incorrectly diagnoses a dependent return type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    Consider:
```
template<typename T>
__attribute__((assume_aligned(2)))
T my_alloc(int);
```
(https://godbolt.org/z/EGebP7o8n)

Clang issues a diagnostic about the return type not being a pointer type despite there being no instantiations. It seems we need to add `if T->isDependentType() return true;` to `isValidPointerAttrType()`, possibly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUsGOqzgQ_JrmYk1kGkLgwCGTDKu9zSHaa2RwQ7wyNrKbWWW__skhM_Pe05MsECrK1V1VKkYzOaIW9q-wP2dq5ZsP7VEF716VtbNyWe_1vT15F42mAMUR5BnkESr5PI9PpnmxigmKE98XcmomcYHibUOvV8UcTL8yXa-ANWCtYlxnuiqb9DVgjYDN8zw4FzHfr8paPwDWxnECitc_igPWN-YlpuGwA-wmr3tveefDBNj9D9i9_UX9-8HX7uv-7Xmyyk3CxLhSFEpooybnI5tBqN6vLPhGIhCvwYm0l3CeRU_GTUKJxRvHFDZAU1wMUyIEev7ivDAusnJsFBvv4k78zSISzVH8R8IRacFeKK0FVNKM4vICxZuJZ1rIaXJ8uS_0sKv5GiKslGyoZGImVvxHWaPft1mOzOGblAzCk1h8jKa3912m20I3RaMyavMD1qWsZS2zWzv2exp0JZt8zPtBNiWWjW5UVUo9DLqhzLQoscylrPMD5nmzG8d6LKs8x0OB42FUUEqalbE7az_m5Hv28LTN83xfFZlVPdn4aBni5L0WowmRN-MBEfAEiEMKA4rjGLxjcjoB-3MW2nTpS79OEUppTeT4LcOGLbW_tkkYN_gQaGB7_4x0i_fT2J8zzdZg29_6Y_i29rvBz4Bdknq-Xpbg_6WBAbutMoDdc8OPFn8EAAD__48qDs0">