This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/24502] New: [gomp] for loop inside template rejected


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]