The following valid code snippet is rejected by the C++ frontend when compiled with -fopenmp:
================================= template<typename> void foo() { int i; #pragma omp for for (i = 0; i < 10; i++) ; } ================================= bug.cc: In function 'void foo()': bug.cc:5: error: expected iteration declaration or initialization It works without the template or if I declare "i" inside the for loop. -- Summary: [gomp] for loop inside template rejected Product: gcc Version: unknown Status: UNCONFIRMED Keywords: rejects-valid, openmp Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24502