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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] warning and error diagnostics when using VLAs at global scope
        </td>
    </tr>

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

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

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

<pre>
    When having `-Wvla-cxx-extension` enabled, Clang diagnoses a global declaration with both a warninga and an error. It would be nice if the warning was suppressed, since it's basically useless when you can't write the code anyways.

```c++
int i = 4;
int arr[i]; // Warns about VLAs and diagnoses that they can't be used at file scope.
```

FWIW a note that `i` isn't a constant expression would also be nice.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcks-O8joMxZ8m3VigkpIGFl3AIKSR7vqydlNPm3szCYpdCm__qYX5o0-KWilybJ9zfsjs-0jUKHNU5lTgKEPKzXXwIfr_rbVFm7pHcxkowoA3H3tQdbm63AKu3P2-ortQZJ-iqkugiG2gTuk3eAsYe-g89jExMSD0IbUYoCMXMKP4FGHyMkCbZACECXP0sUfA2AFGoJxTXsO7wJTG0EFLEL0j8B8gA32Vw4QMPF6vmZifk9nHuUyUtgwtsncYwgNGpkDMMM1KHmkEh1FpKzBlL7T0dKkjwPiY8MFrVZ5UeXh96_J5nNLH-Sy3Pgp4UNUJtqr6dYc5K3P0ypxUdQSlz0qf4YI5MmCbRoF__znwIvPHHhlQ5h0e32u1NK_cAQp8-EDALl1p_dc-v5c8X94vgBDTogZlzsnPqXh-dkRwKbJgFKD7YtiSweIuBk5fFr-GFF1TdftqjwU1G6tNvTc7WxVD49BUO7PZE213xuzqvXG072o05a4znd0UvtGl3pb70pbWWFOt6w19mJ1z2lZY40arbUmf6MM6hNvnOuW-8MwjNZvS1nZbBGwp8EKk1m4GSVWHl1fiHSutZ1RzMz9ftWPPalsGz8I_DcVLWKBeQFTm9E3MbPwCF_xq-cRi5LngGY98AbsYX4w5NIPIlVV1eEbaexnGdu3Sp9Lnee7rt7rm9B85Ufq8qGKlzy9ht0b_CQAA__9GjRsV">