Message ID | 20110519131659.GN17079@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
--- gcc/cp/decl.c.jj 2011-05-17 13:32:18.000000000 +0200 +++ gcc/cp/decl.c 2011-05-19 10:27:46.000000000 +0200 @@ -2833,6 +2833,8 @@ check_omp_return (void) error ("invalid exit from OpenMP structured block"); return false; } + else if (b->kind == sk_function_parms) + break; return true; } --- libgomp/testsuite/libgomp.c++/pr49043.C.jj 2011-05-19 10:31:57.000000000 +0200 +++ libgomp/testsuite/libgomp.c++/pr49043.C 2011-05-19 10:22:47.000000000 +0200 @@ -0,0 +1,19 @@ +// PR c++/49043 +// { dg-options "-std=c++0x" } +// { dg-do run } + +extern "C" void abort (); + +int +main () +{ + int r = 0; + #pragma omp parallel for reduction (+:r) + for (int a = 0; a < 10; ++a) + { + auto func = [=] () { return a; }; + r += func (); + } + if (r != 45) + abort (); +}