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

    <tr>
        <th>Summary</th>
        <td>
            [clang] 21.1.0-rc2: compilation error due to misdetecting returning function as noreturn
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    I'm not sure since when it is happening, but it's a recent addition to some RC that got used in https://github.com/mstorsjo/llvm-mingw
I didn't have time to fully bisect a version.

The error is:
```
/50-vvenc/source/Lib/CommonLib/Buffer.cpp:740:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
```

Referring to the relevant source here:
https://github.com/fraunhoferhhi/vvenc/blob/master/source/Lib/CommonLib/Buffer.cpp#L740
https://github.com/fraunhoferhhi/vvenc/blob/master/source/Lib/CommonLib/Buffer.h#L177

There is nothing indicating that this function is supposed to be noreturn.

My build script is doing nothing special for vvenc either, so this should be reproducable by just building vvenc with an affected clang version.
I'm targetting win-on-aarch64 with my builds, in case it does not happen on other arches.

cc @mstorsjo 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8VE2L4zgQ_TXKpUiQlThODj6k0xgGZvcwLMxZH-WoGlky-kjT_36RnXTDHpo9DeQgYqrqvVevnkyJbh6xZ-0La183smQbYv-S1d8bFcxH_4OJbgIfMqQSERJ5jfBu0QNloARWzjN68jcmrqBKBspMdAkkRNToM0hjKFPwkAOkMCH8ukK2MsMtZCgJDZAHm_Oc2P7CxMDEcKNsi9rpMDExTCmHmN4CE4Nz92k7kb-9M375AYaMZ6LLYOUdIdOEdcZYnPsARQl1Bgl3jImC3zF-Yfzyj0XAGEMEWsbxCzvyx4_X6S3f3u_oNRNDCiVqZGL4SYqJ4RqmKfj1_VLGEeNOzzPbX7oDZ_tLw_aXtXV9jMXrhbRB7WREA0x0PkTMJVbMkGwoziy6rn8Ca1-2v9cG4rr9Tf4uHZntZ1H7-l-0_PILR4yR_K0SzxYhosO79BlW8GAx4srzG4XHKIu3YcRoLTExPAVQLlSyk0wZ4_8WROx_VkX-0ERb5zVd97neiNWVPmRbZSFvSMu8KFQ9ly2lr-VQglTmOVQT5gAK4an2wy5_fYAq5AwkHWle_G5Cbfbsn2bUJB2MIcJCApCyrdivkMI67rFqVbczx2CKlsohqA94KymvA2qvtf6dsgXpQY4j6owGtJP145eN14vMMt4wL8zeyW-D30oZtT0e1g7TA3mqSMiDlgnrxZqAizqPu4XgIVTAUIsxPXhrDezAn5cHG9PvzXl_lhvsm6498K7h5_PG9s1RKjzx8-HEueyOe-zk2ajmeOqkark-bagXXLT8xJuma0_NebfXauxOqJRoGzU2gh04TpLcrt72LsTbhlIq2Ddt0x3ExkmFLi3hJMSiBBOi5lTslzBQ5ZbYgTtKOX21yJTdkmhrRfsKotk1O76NWtTr1GGaycnFA2samLJkx0TJYEa9yLo6ob4-DSPTp0M2Jbr-G4tXMM_ImmN4Q52ZGBZyiYnhwe_ei38DAAD__8wy1c4">