<div dir="ltr">Hey,<div><br></div><div>The following code:</div><div><br></div><div><div>int main(void)</div><div>{</div><div> struct s {</div><div> typeof( ({ int x = 0; x; }) ) y;</div><div> };</div><div>}</div>
<div><br></div><div>appears to be valid, and is accepted by gcc.</div><div><br></div><div>But it is rejected by clang:</div><div><br></div><div><div>clangtest.c:4:24: error: non-const static data member must be initialized out of line</div>
<div> typeof( ({ int x = 0; x; }) ) y;</div><div> ^ ~</div><div>clangtest.c:4:17: error: statement expression not allowed at file scope</div><div> typeof( ({ int x = 0; x; }) ) y;</div>
</div><div><br></div><div>Is this a bug, or intended behavior?</div><div><br></div>-- <br><div dir="ltr">Eyal</div>
</div></div>