<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83658>83658</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Type definitions should be allowed inside of the offsetof type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Halalaluyafail3
</td>
</tr>
</table>
<pre>
Clang does not accept type definitions inside of the type provided to offsetof. However, I don't see any wording which forbids this. Here is an example program (Clang 16 and newer don't seem to accept this):
```c
#include<stddef.h>
int main(void){
offsetof(struct{int a;},a);
}
```
There was a proposal (N2350) which added some text to make this UB, but that has been changed since by DE-137 (N3148) which removes this restriction and only makes it UB if there is an unparenthesized comma inside of offsetof. N3167 includes discussion about accepting DE-137.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU8uSozgQ_BpxqWgHSOZ14LDuHkfvZU4zH1CgArQrJEIl7PF-_YawPd3TAQEBJVVlpjKR2UyOqBPlSZRvGW5x9qF7R5uu7YYjGquy3utb92rRTaA9MTgfAYeB1gjxthJoGo0z0XjHYBwbTeBHiDPdy2vwF6NJQ_Tgx5Ep-vEA7_5KFwpCvsLfoL0Tso7ARIDuBlcftHETXGczzDD60BvNEGfDB3inQGAY0AH9wmW1-4Qp4AJCNneYRQXoNDi6UvjcfEkYntBnw0K2Qv0l8jeRP59Vfr-Hx7dUxg120yTUK0etaTzMQn27V42LsKBxQjYXb3RqV5_upd9UhWw4hm2Ioj6l9SjUSdRvQr7iPv6xPv36E8FnWD_mxPqKDJjYrp7RJrrfpSpzIduHUqiTzuwXgki_YmK74L-0c4WfpyR2vyXqGGFGhp7IwTCjm9I24waC_gZv314KVe_tVXFsPtoHWvyF7gcBgTgGM6Rj38X2zt72aQwmws8TmN0Dvw9rcysGcnEmNv-RhsEvC37yy4c1vquiquEhO4M2PGzM-5zeb0_vJX_ckR4y3SndqhYz6oo6b1WpyqLK5i6vjkfs26Zsxlo3eVPIcaxJVUNetCW1lJlO5vKYq1zmR1kW1QHHY1Fg1Za1bMuhasUxpwWNPVh7WQ4-TJlh3qhrVFU2mcWeLO_xkdLRFfaikDKlKXRpz0u_TSyOuTUc-aNLNNFS9-NrfHj2m9XQE6C1_kr6S6CeIu3JyrZguznGlZOJ5VnI82TivPWHwS9CntOwx-tlDf4fGqKQ5x0iC3neKfwfAAD__7q2TSo">