diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0222-PR-c-40975.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0222-PR-c-40975.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0222-PR-c-40975.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0222-PR-c-40975.patch new file mode 100644 index 0000000000..b0efd67cb1 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0222-PR-c-40975.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 0870d53c5df3fbecd862b72a46d449e6453a8584 Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Thu, 5 May 2011 21:02:06 +0000 | ||
4 | Subject: [PATCH] PR c++/40975 | ||
5 | * tree-inline.c (copy_tree_r): Handle STATEMENT_LIST. | ||
6 | |||
7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173452 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
8 | |||
9 | index 59ac0f1..1ec4866 100644 | ||
10 | new file mode 100644 | ||
11 | index 0000000..24582d8 | ||
12 | --- /dev/null | ||
13 | +++ b/gcc/testsuite/g++.dg/init/new30.C | ||
14 | @@ -0,0 +1,15 @@ | ||
15 | +// PR c++/40975 | ||
16 | + | ||
17 | +struct data_type | ||
18 | +{ | ||
19 | + // constructor required to reproduce compiler bug | ||
20 | + data_type() {} | ||
21 | +}; | ||
22 | + | ||
23 | +struct ptr_type | ||
24 | +{ | ||
25 | + // array new as default argument required to reproduce compiler bug | ||
26 | + ptr_type (data_type* ptr = new data_type[1]) { delete[] ptr; } | ||
27 | +}; | ||
28 | + | ||
29 | +ptr_type obj; | ||
30 | diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c | ||
31 | index fd8edb4..f2255f8 100644 | ||
32 | --- a/gcc/tree-inline.c | ||
33 | +++ b/gcc/tree-inline.c | ||
34 | @@ -4334,14 +4334,16 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) | ||
35 | CONSTRUCTOR_ELTS (*tp)); | ||
36 | *tp = new_tree; | ||
37 | } | ||
38 | + else if (code == STATEMENT_LIST) | ||
39 | + /* We used to just abort on STATEMENT_LIST, but we can run into them | ||
40 | + with statement-expressions (c++/40975). */ | ||
41 | + copy_statement_list (tp); | ||
42 | else if (TREE_CODE_CLASS (code) == tcc_type) | ||
43 | *walk_subtrees = 0; | ||
44 | else if (TREE_CODE_CLASS (code) == tcc_declaration) | ||
45 | *walk_subtrees = 0; | ||
46 | else if (TREE_CODE_CLASS (code) == tcc_constant) | ||
47 | *walk_subtrees = 0; | ||
48 | - else | ||
49 | - gcc_assert (code != STATEMENT_LIST); | ||
50 | return NULL_TREE; | ||
51 | } | ||
52 | |||
53 | -- | ||
54 | 1.7.0.4 | ||
55 | |||