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

    <tr>
        <th>Summary</th>
        <td>
            Clang accepts a bogus typedef
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            accepts-invalid
      </td>
    </tr>

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

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

<pre>
    Currently, clang accepts `typedef void Func() const;` for some reason, while rejecting this construct in most other cases (e.g. when trying to make a pointer to it). It gets really weird when using it with classes. e.g.
```c++
using Func = void() const;

template <class T>
class S {
  T* t;
};

int main() {
  S<Func> f; // expected-error {{pointer to function type 'void () const' cannot have 'const' qualifier}}
}
```

Clang will happily accept this code when not using `T` inside `S`.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU9uOqzgQ_JrmpRVkDOHywEMuJ9I-z_yAYzrgPcZmbZNs_n5lkz2TGckCuaGqXV0u4b0aDVEP-yPsz5lYw2Rdv0xKG_W7aZrsaodnf1qdIxP0E_gJpRZmRCElLcEj1Cw8FxrohnerBrysRgJvgXcorfEByiPUDG_WobczoSPhrYk8j0npuP-bZFBmxDApv2HcKgMqg7P1AW2YyKEUnjwCbykfc3xMZDC4Z4JZnMVvQoGLVSaQixUVgHc5_hVwpOBjU62f-CDlhg28-ohVAR8qTFGS9-RzjOzAzsAOULNtSeDHuFJ1g0WNCOU5Kf4pdkOnZ6B50SIQQnlKLfATyl_bt23_gdC8IIifwA_4xtGcf_ApE3AWyrxavkE_oDylyZe_8AblEYFfgF-Q_l1IBhp25Jx1CdEc3-Z0W40MyhqMHiLwJnn4TRJvUApjbMBJ3NM_f-r_rEKrmyIXj9qcv479fYLvEk7p8jyU1jiJZVH6-bpJ_9s_0GZQbLhNG2r2Ga-QMl4NFLcfULOXTdnQl0NXdiKjvqi7oihYtW-zqRdXzljBeMeaUlaCdVLWdcELdm2LjtGQqZ4zXrKWVYztq6LNWV0VrNy3bbcvq2EgqBjNQulc6_ucWzdmyvuV-rqqGM-0uJL2KTecp0hAebg5awKZATgHfgLOXynZKXMXWqX6_py5PlLuruvooWJa-eC_mgQVNPWnbyETeLXj6vGVtGx1up9CWDyUh83pUYVpvebSzsAvkev12i3OxoABv6TTe-CXJOC_AAAA___3rzkN">