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++/24512] New: [gomp] Bogus error message about redeclared variables


The following valid code snippet is rejected when compiled with -fopenmp:

=============================================
template<int> void foo()
{
#pragma omp for
    for (int i=0; i<10; i++) ;

#pragma omp for
    for (int i=0; i<10; i++) ;
}

void bar()
{
    foo<0>();
}
=============================================

bug.cc: In function 'void foo() [with int <anonymous> = 0]':
bug.cc:12:   instantiated from here
bug.cc:7: error: redeclaration of 'int i'
bug.cc:4: error: 'int i' previously declared here


-- 
           Summary: [gomp] Bogus error message about redeclared variables
           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=24512


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