<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68487>68487</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang doesn't allow aliasing forward-declared static objects
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pskocik
</td>
</tr>
</table>
<pre>
Example:
```
static int x_;
static int x;
static int x = 42;
static int x_ __attribute((alias("x")));
```
The example works with s/static/extern/g, but the static version, accepted by GCC, fails on clang with `error: alias definition of 'x_' after tentative definition`. Unfortunately there's no way to issue a declaration of a static object without also tentatively defining it, AFAIK.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxskk-PmzwQxj_NcBltZEz4d-CQTV5eVb2258iGIbjr2JE9bJJvX5lkta26kiVgbM_zm4dHxWhOjqiD8hXKQ6YWnn3oLvHND-Yt0368d__d1PliCYodiAOIHVTiudbPyIrNgMYx3o5QvP5b_bKIUBxwK7_cO-LxqJiD0QsTyAZko6xRcX2VN5ASZPtcH_e_ZPsxE9IDH68-vEW8Gp4xguwfeiB7ujEFB7I_gdyjXhh5JnzivFOIxru0o4aBLkwj6jv-v9-nEk7K2Ije4WCVOz2aQyUoBB-g2OFKjSNNxhk23qGfEGR9O4KsUU1MAZlcknqnP45BJTb4000-8OIUk70npkAg64jO41XdkT2aGBdChSMNVgX1IaA-4L3-RQOvVH5hVDb6Tzl7fwq6ExpO0-z63bfvm2zsirEtWpVRl1dtVbWiEEU2d5NWjaah0fmW9FjqfNRtmatKDqqZ2nLKTCeFLHIh6nxb5ttiM1STyOUkyqmsRZVXsBV0VsZurH0_b3w4ZesEXdVsmzqzSpONaxClXP1M_7k8ZKFL51_0coqwFdZEjp8d2LClbr_aP3qKDmSdRrX--nA_zTf5cFVhfHkYRePfBsVsCbabmS8xZVz2KQuG50VvBn8G2Sex5-PlEny6A7Jf2VOSVvzfAQAA__8HAg6j">