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

    <tr>
        <th>Summary</th>
        <td>
            various warnings incorrectly included in `-Wc++20-compat`
        </td>
    </tr>

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

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

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

<pre>
    Example:
```c++
template<typename T> consteval T::type f();
```
... compiled with `-std=c++20 -Weverything` produces:
```
<source>:1:32: warning: use of implicit 'typename' is incompatible with C++ standards before C++20 [-Wc++20-compat]
    1 | template<typename T> consteval T::type f();
      | ^
<source>:1:22: warning: 'consteval' specifier is incompatible with C++ standards before C++20 [-Wc++20-compat]
    1 | template<typename T> consteval T::type f();
      |                      ^
```
This doesn't make any sense. `-Wc++XY-compat` is supposed to warn about compatibility issues that would arise when compiling with `-std=c++XY`. But that's not what these warnings are about at all!

These warnings should be in `-Wpre-c++20-compat`, because they warn about compatibility issues that would arise when compiling with standards earlier than `-std=c++20`. It'd be good to do a survey of other `-Wc++XY-compat` warnings too, to check for other places we might have got this wrong.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUlEGPozgQhX9NcSkFGRMgOXAg6Y6095Fm5migAO8YjOwiWfbXr0yS7tnZ7tPuZRFSHBmX3_fq2cp73U9EJWQnyF4itfBgXfnn2ltjdRvVtl3L1z_UOBuCtAJRQS7ubwPyFF5RMY2zUUyQnnmdaVIj4RdIX7Gxk2e6KhP-VpBWYRo7kAeQR0hPP5cDUcVxjI0dZ22oxZvmASEXO88tpC-P3aTA3Ve6klt50FMPucDZ2XZpyP8iL4zTs7eLawjSV0irBNIqlZBWeFNuCqvTChdPaDvU42x0oxlBFk8GkAVqj3oKmhTr2tBd1fmuBT2rqVWu9VhTZx09J6RAyE67r2-ad_cKkL2AqBARE4TijP_GN9yeUAWy149Z5a-sIIu3ygHOz9ToTpP7P2B--DzYf-r5l0F7bC35KXQSR_WDUE0repo8xVugnoK_fX8KzkVwwC_zbD21yHZzDVVtF8anLdpoXlF7v5BHHhTjzS6mReW0J7wNND3Cq6f-k_R--w65iPG08FYAZOFxsoy3UI0HCnXu7fKoHD0EKEZlDMgkoAbCv33nh01FTainO97saPePnuQC5BlralRIPA-0_jeM7-Eg5UzIEg9q-ujgbui_BehNbW_t5nRrUaFf3JXWcBAtD-Q-b9MbNlsbgNhiM1DzAzvrHmtnoxryeCMcdT8wDuoadgsGa483Z6c-jtoybY_pUUVUJsU-z4rkIJNoKI8q6dp9LbNj0aj2UFBGXZI0e5lQktSURLqUQmYiE7mUmZBJ3FFH3bHY1_UxVYcsh72gUWkTG3MdY-v6aLOzTNJDUWSRUTUZv123Uk50u5sNUobb15Vh0a5eeg97YbRn_16GNRsqr8ppu_h3I8K5dY4aNmsYm6Wl9i0KH8QgWpwpB-Z5uzDlBeSl1zwsddzYEeQl7Pf42c3O_k4Ng7zcIwHy8sC4lvKvAAAA__9OlPET">