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

    <tr>
        <th>Summary</th>
        <td>
            Issue diagnostic when defining a type in offsetof
        </td>
    </tr>

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

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

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

<pre>
    https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm was adopted for C2x and makes it clear that defining a type in `offsetof` is undefined behavior. We already diagnose when referencing a bit-field, which is also UB, so we might as well catch this one as well.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUtuO3CAM_ZrkxZqIkMtsHvKwu1WlfkDVZwecwC6BETibzt-XZDSqVFVC-HZ0fGyYgr6PhvmWiua1kN_z2fe9Cjfyl8S6CnHJqQ9WdTZJSXkAlrp94PKtg0rZeNl0ojK8wo4JUIcbk4Y5RHiXvwG9hhU_KYFlUI4wAhtk0DRbb_0CCHy_EVgPRS_CPCfiMGcXbILNn7BMN5HBLxtiBb8I0EVCfQdtcfEhEeyGPESaKZJXD9LJ8mW25HQh33PdKnMQoksBfr4duezsBKtdDEPWvZNzoJAzjk1GBk_PdFXSWPe9qHvRSVHqsdFDM2DJlh2NP1La6CmFrXqI-c94z9nKLbp_9r5YNttUqbDmwLmvp7ncYvggxTm0R5tj3d1V9F1pxqFR8joNV0Xzi2wHOQ9iagRS37dzLjWlw4lcGosujys97XBSZL_ovpV2lEJK8VKLemjrbqjyG6qha_qrbsU01XPRClrRuurQcfyFMo6npGlbUi46mzj9LWJKdvFEZ7vMjxubEMdXjMG_oXMr-vLsP576_wDPldGf">