re PR c++/49043 ([OpenMP & C++0x]: Compiler error when lambda-function within OpenMP loop)
PR c++/49043 * decl.c (check_omp_return): Stop searching on sk_function_parms. * testsuite/libgomp.c++/pr49043.C: New test. From-SVN: r173907
This commit is contained in:
parent
5ee093edf0
commit
ea93a47bc8
@ -1,5 +1,8 @@
|
||||
2011-05-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/49043
|
||||
* decl.c (check_omp_return): Stop searching on sk_function_parms.
|
||||
|
||||
PR c++/48869
|
||||
* method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
|
||||
pass it down to locate_fn_flags.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
2011-05-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/49043
|
||||
* testsuite/libgomp.c++/pr49043.C: New test.
|
||||
|
||||
PR c++/48869
|
||||
* testsuite/libgomp.c++/pr48869.C: New test.
|
||||
|
||||
|
19
libgomp/testsuite/libgomp.c++/pr49043.C
Normal file
19
libgomp/testsuite/libgomp.c++/pr49043.C
Normal file
@ -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 ();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user