diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0284-PR-c-49043.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0284-PR-c-49043.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0284-PR-c-49043.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0284-PR-c-49043.patch new file mode 100644 index 0000000000..de60b246a3 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0284-PR-c-49043.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 0b87dda7f297f6ebd65eef8828710c05a1dd9543 Mon Sep 17 00:00:00 2001 | ||
2 | From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Thu, 19 May 2011 13:13:57 +0000 | ||
4 | Subject: [PATCH] PR c++/49043 | ||
5 | * decl.c (check_omp_return): Stop searching on sk_function_parms. | ||
6 | |||
7 | * testsuite/libgomp.c++/pr49043.C: New test. | ||
8 | |||
9 | |||
10 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173908 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
11 | |||
12 | index 74bae0b..81d5db3 100644 | ||
13 | --- a/gcc/cp/decl.c | ||
14 | +++ b/gcc/cp/decl.c | ||
15 | @@ -2807,6 +2807,8 @@ check_omp_return (void) | ||
16 | error ("invalid exit from OpenMP structured block"); | ||
17 | return false; | ||
18 | } | ||
19 | + else if (b->kind == sk_function_parms) | ||
20 | + break; | ||
21 | return true; | ||
22 | } | ||
23 | |||
24 | new file mode 100644 | ||
25 | index 0000000..604cfc3 | ||
26 | --- /dev/null | ||
27 | +++ b/libgomp/testsuite/libgomp.c++/pr49043.C | ||
28 | @@ -0,0 +1,19 @@ | ||
29 | +// PR c++/49043 | ||
30 | +// { dg-options "-std=c++0x" } | ||
31 | +// { dg-do run } | ||
32 | + | ||
33 | +extern "C" void abort (); | ||
34 | + | ||
35 | +int | ||
36 | +main () | ||
37 | +{ | ||
38 | + int r = 0; | ||
39 | + #pragma omp parallel for reduction (+:r) | ||
40 | + for (int a = 0; a < 10; ++a) | ||
41 | + { | ||
42 | + auto func = [=] () { return a; }; | ||
43 | + r += func (); | ||
44 | + } | ||
45 | + if (r != 45) | ||
46 | + abort (); | ||
47 | +} | ||
48 | -- | ||
49 | 1.7.0.4 | ||
50 | |||