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

    <tr>
        <th>Summary</th>
        <td>
            C23 constexpr should not have external linkage
        </td>
    </tr>

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

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

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

<pre>
    Hi,
thanks for implementing `constexpr` for clang-19!

The following code

```{.C}
constexpr int category_width = 5;
int const w = 5;
int const* a = &category_width;
```
compiles, but produces an external symbol for `category_width` and then multiple defined symbol errors on linkage. So I cannot use `constexpr` in header files, or I'd have to prefix it with `static`, which defeats the purpose of `constexpr` ...

C23 has in 6.2.2 p3

> If the declaration of a file scope identifier for:
> — an object contains any of the storage-class specifiers `static` or `constexpr`;
> — or, a function contains the storage-class specifier `static`,
> then the identifier has internal linkage.

Thanks
Jens
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VE2P6zYM_DXyhYihyF_JwYe3yQu6vbb3QpZoW32yZIjyZvPvCznZfHTRAkESmORwOBxaEpnBIbasemPVMZNLHH1oh4Ui6ph1Xl_a3wwTB8aPjP-Io3S_CHofwEyzxQldNG4AVnPlHUX8nAOr-ZqgrHTDZrtnYnstvn7_OSL03lp_ToXKa3yOsprfPs1bfmDN8fr4Dg7GRVAy4uDD5a-z0XEEVhyhYsXbNXVNSOlw_q8IEz9ArkEm6lewe_KDyI3ANBuLxMQBuiXCHLxeFBJIB_gZMThpgS5T5-06fBLkFbjmIJ2GOKKDabHRzBZBY28c6q9KDMEHAu_AGvdLDpjDHx7eQUnnfISF8JvSxsGIUmOA_oufD_DORKNhlB8I0cMcsDefYCKcTdKr5hRlNCpNJw5wHo0aExWUkRJBmJcwe0Lw_bd-eZ4_7-sgChglJRp1LnIBc_GyzuInvPcrpkZlZZDReJdw5coXSPkZwejko96kKXxgxVM1-ynYjrN9mZT23d-o1iVGaVwS_5KwEjxFH-SAG2UlEdCMasWjl2nhtpmngR4Lf2nmQ1JGQr84tVK-9_yfZv9W9gG8bj1VPk16le1mna99v15KOrbr_9_RUabbQu-Lvcyw3TaCb_e8KkU2tiVWZVEr7LloymqrmqKpkW-bpuz6Sux0ZlrBRckbXm3LUgiR76p92WO567hqOiU5KzlO0tjc2o8p92HIDNGC7b7ZFTyzskNL6ytCCIdnWINMiPTGCG2q2XTLQKzk1lCkB0o00WKbTPK4YBr9YjUkQ68GvZ_PTYNsCbYdY5wpGUGcmDgNJo5Llys_MXFK4LefzRx8cgQTp5USMXG6Uv5oxT8BAAD__-GHil4">