This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35158] New: g++ does not compile valid C++ for loops with -fopenmp
- From: "kugelfang at gentoo dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2008 00:35:58 -0000
- Subject: [Bug c++/35158] New: g++ does not compile valid C++ for loops with -fopenmp
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following C++ programm will not compile using current
either gcc-4.2.2 or gcc-4.3.0(svn):
int main(int argc, char *argv[])
{
#pragma omp parallel for
for (int i(0) ; i < 10 ; i++)
;
return 0;
}
The error messages for 'g++ -fopenmp -o foo foo.cc' are:
foo.cc: In function 'int main(int, char**)':
foo.cc:4: error: expected primary-expression before 'int'
foo.cc:4: error: expected `;' before 'int'
foo.cc:4: error: expected primary-expression before 'int'
foo.cc:4: error: expected `;' before 'int'
foo.cc:4: error: expected primary-expression before 'int'
foo.cc:4: error: expected `)' before 'int'
foo.cc:4: error: expected iteration declaration or initialization
foo.cc:4: error: 'i' was not declared in this scope
foo.cc:4: error: expected `;' before ')' token
The program compiles without error messages when I use 'g++ -o foo foo.cc'!
--
Summary: g++ does not compile valid C++ for loops with -fopenmp
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kugelfang at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35158