[Bug c++/49043] [OpenMP & C++0x]: Compiler error when lambda-function within OpenMP loop

bisqwit at iki dot fi gcc-bugzilla@gcc.gnu.org
Thu May 19 08:30:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49043

--- Comment #2 from Joel Yliluoma <bisqwit at iki dot fi> 2011-05-19 08:10:06 UTC ---
Even if the lambda function is not called, it happens. Merely defining the
function causes it.
Interestingly though, it does not happen if a method body is defined within the
loop. The code below does not cause the error. So it is restricted to lambda
function bodies.
It also does not happen when calling lambda functions that are defined outside
the loop.

int main()
{
    #pragma omp parallel for
    for(int a=0; a<10; ++a)
    {
        struct tmp
        {
            static int test() { return 0; }
        };
    }
}



More information about the Gcc-bugs mailing list