On Fri, Mar 25, 2016 at 18:23:23 +0300, Ilya Verbin wrote: > On Mon, Mar 21, 2016 at 15:58:18 +0100, Jakub Jelinek wrote: > > On Mon, Mar 21, 2016 at 05:45:52PM +0300, Ilya Verbin wrote: > > > www.cilkplus.org/sites/default/files/open_specifications/Intel_Cilk_plus_lang_spec_1.2.htm > > > says: > > > In C++, the control variable shall be declared and initialized within > > > the > > > initialization clause of the _Cilk_for loop. The variable shall have > > > automatic > > > storage duration. The variable shall be initialized. Initialization may > > > be > > > explicit, using assignment or constructor syntax, or implicit via a > > > nontrivial > > > default constructor. > > > > > > This patch enables constructor-syntax initialization. > > > Bootstraped and regtested on x86_64-linux. OK for stage1? > > > > Does this affect just _Cilk_for or also #pragma simd? > > It affects both. > > > What about (some_class i { 0 }; some_class < ...; some_class++) > > and similar syntax? > > It's allowed, thanks, I missed this in the initial patch. > > > The testsuite coverage is insufficient (nothing e.g. > > tests templates or #pragma simd). > > Patch is updated. Is it sufficient now? > > > gcc/cp/ > * parser.c (cp_parser_omp_for_loop_init): Allow constructor syntax in > Cilk Plus for-loop initialization. > gcc/testsuite/ > * g++.dg/cilk-plus/CK/for2.cc: New test. > * g++.dg/cilk-plus/for5.C: New test.
Ping. -- Ilya