https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93239

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
I'd be concerned about trouble when code processing statements tries to 
deal with context that doesn't exist outside of functions.  Consider a 
statement expression containing a function definition (does that count as 
a nested function?), statement expressions containing declarations, 
possibly with extern, possibly not (how do those interact with file-scope 
declarations?), statement expressions containing _Atomic operations (see 
the sort of issues we had in bug 65345, though that was fixed), statement 
expressions containing __local__ declarations and goto.  It would be 
necessary to go through language features systematically, especially 
declarations and language features that try to create declarations 
internally, to ensure they behave sensibly inside statement expressions at 
file scope - and to test all the same features in old-style parameter 
declarations to ensure declarations from those features don't get mixed up 
in the parameter declaration handling.

(I concur that unevaluated statement expressions *should* be allowed at 
file scope, but think such a change would need pretty extensive test 
coverage of language features that are likely to be risky in such a 
context.)

Reply via email to