http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52600
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |rth at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-26 10:17:02 UTC --- In C++ we accept this, in C we don't (we call c_parser_statement, but declarations aren't handled by that, due to the allowing/disallowing of mixing of declarations and statements in C99 vs. C90). I guess we could move the loop body from c_parser_compound_statement_nostart to a new function and use it there as well as in c_parser_omp_structured_block, c_parser_omp_{parallel,task} and c_parser_omp_sections_scope. It is very ugly to allow there declarations though, that means code behaves very differently between -fopenmp and -fno-openmp - in the former case the declared var would go out of scope immediately, in the latter would be around until closing }.