diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0240-Fix-PR-c-48574.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0240-Fix-PR-c-48574.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0240-Fix-PR-c-48574.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0240-Fix-PR-c-48574.patch new file mode 100644 index 0000000000..d4cb2847f4 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0240-Fix-PR-c-48574.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From 870a98366a1b44e999c9ecee9e777b10d4c10ec9 Mon Sep 17 00:00:00 2001 | ||
2 | From: dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Mon, 9 May 2011 12:34:19 +0000 | ||
4 | Subject: [PATCH] Fix PR c++/48574 | ||
5 | |||
6 | gcc/cp/ | ||
7 | |||
8 | PR c++/48574 | ||
9 | * class.c (fixed_type_or_null): Use type_dependent_p_push to test | ||
10 | if the instance has a dependent initializer. | ||
11 | |||
12 | gcc/testsuite/ | ||
13 | |||
14 | PR c++/48574 | ||
15 | * g++.dg/template/dependent-expr8.C: New test case. | ||
16 | |||
17 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173571 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
18 | |||
19 | index c833329..e1b8645 100644 | ||
20 | --- a/gcc/cp/class.c | ||
21 | +++ b/gcc/cp/class.c | ||
22 | @@ -5937,7 +5937,7 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp) | ||
23 | itself. */ | ||
24 | if (TREE_CODE (instance) == VAR_DECL | ||
25 | && DECL_INITIAL (instance) | ||
26 | - && !type_dependent_expression_p (DECL_INITIAL (instance)) | ||
27 | + && !type_dependent_expression_p_push (DECL_INITIAL (instance)) | ||
28 | && !htab_find (ht, instance)) | ||
29 | { | ||
30 | tree type; | ||
31 | new file mode 100644 | ||
32 | index 0000000..20014d6 | ||
33 | --- /dev/null | ||
34 | +++ b/gcc/testsuite/g++.dg/template/dependent-expr8.C | ||
35 | @@ -0,0 +1,25 @@ | ||
36 | +// Origin PR c++/48574 | ||
37 | +// { dg-options "-std=c++0x" } | ||
38 | +// { dg-do compile } | ||
39 | + | ||
40 | +struct A | ||
41 | +{ | ||
42 | + virtual int foo(); | ||
43 | +}; | ||
44 | + | ||
45 | +void baz (int); | ||
46 | + | ||
47 | +template <typename T> | ||
48 | +void | ||
49 | +bar(T x) | ||
50 | +{ | ||
51 | + A &b = *x; | ||
52 | + baz (b.foo ()); | ||
53 | +} | ||
54 | + | ||
55 | +void | ||
56 | +foo() | ||
57 | +{ | ||
58 | + A a; | ||
59 | + bar(&a); | ||
60 | +} | ||
61 | -- | ||
62 | 1.7.0.4 | ||
63 | |||