diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-04-30 12:37:47 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-05 12:26:41 +0100 |
commit | 478deec11f3349d61b1a922f047dc958dc07262a (patch) | |
tree | 1843907b36de2bcb8f821d49d8c9a88014ef0dc7 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch | |
parent | d42dccf886983ba14ccc868041d7bea0cf1a260e (diff) | |
download | poky-478deec11f3349d61b1a922f047dc958dc07262a.tar.gz |
gcc-4.6.0: Backport FSF 4.6 branch patches
This is set of bugfixes that has been done on
FSF gcc-4_2-branch since 4.6.0 was released
They will roll into 4.6.1 release once that
happens in coming approx 6 months time then
we can simply remove them thats the reason
so use a separate .inc file to define the
SRC_URI additions
(From OE-Core rev: b0d5b9f12adbce2c4a0df6059f5671188cd32293)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch new file mode 100644 index 0000000000..343e0ce476 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0030-pt.c-build_non_dependent_expr-Keep-dereferences-outs.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From 6ec20c02d4514be339f0112d793794abf60451a7 Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Tue, 29 Mar 2011 14:25:51 +0000 | ||
4 | Subject: [PATCH 030/200] * pt.c (build_non_dependent_expr): Keep dereferences outside the | ||
5 | NON_DEPENDENT_EXPR. | ||
6 | |||
7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171671 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
8 | |||
9 | index 2e18588..d649628 100644 | ||
10 | --- a/gcc/cp/pt.c | ||
11 | +++ b/gcc/cp/pt.c | ||
12 | @@ -18851,24 +18851,17 @@ build_non_dependent_expr (tree expr) | ||
13 | TREE_OPERAND (expr, 0), | ||
14 | build_non_dependent_expr (TREE_OPERAND (expr, 1))); | ||
15 | |||
16 | + /* Keep dereferences outside the NON_DEPENDENT_EXPR so lvalue_kind | ||
17 | + doesn't need to look inside. */ | ||
18 | + if (TREE_CODE (expr) == INDIRECT_REF && REFERENCE_REF_P (expr)) | ||
19 | + return convert_from_reference (build_non_dependent_expr | ||
20 | + (TREE_OPERAND (expr, 0))); | ||
21 | + | ||
22 | /* If the type is unknown, it can't really be non-dependent */ | ||
23 | gcc_assert (TREE_TYPE (expr) != unknown_type_node); | ||
24 | |||
25 | - /* Otherwise, build a NON_DEPENDENT_EXPR. | ||
26 | - | ||
27 | - REFERENCE_TYPEs are not stripped for expressions in templates | ||
28 | - because doing so would play havoc with mangling. Consider, for | ||
29 | - example: | ||
30 | - | ||
31 | - template <typename T> void f<T& g>() { g(); } | ||
32 | - | ||
33 | - In the body of "f", the expression for "g" will have | ||
34 | - REFERENCE_TYPE, even though the standard says that it should | ||
35 | - not. The reason is that we must preserve the syntactic form of | ||
36 | - the expression so that mangling (say) "f<g>" inside the body of | ||
37 | - "f" works out correctly. Therefore, the REFERENCE_TYPE is | ||
38 | - stripped here. */ | ||
39 | - return build1 (NON_DEPENDENT_EXPR, non_reference (TREE_TYPE (expr)), expr); | ||
40 | + /* Otherwise, build a NON_DEPENDENT_EXPR. */ | ||
41 | + return build1 (NON_DEPENDENT_EXPR, TREE_TYPE (expr), expr); | ||
42 | } | ||
43 | |||
44 | /* ARGS is a vector of expressions as arguments to a function call. | ||
45 | new file mode 100644 | ||
46 | index 0000000..12e363a | ||
47 | --- /dev/null | ||
48 | +++ b/gcc/testsuite/g++.dg/cpp0x/move1.C | ||
49 | @@ -0,0 +1,15 @@ | ||
50 | +// { dg-options "-std=c++0x -pedantic-errors" } | ||
51 | + | ||
52 | +#include <utility> | ||
53 | + | ||
54 | +class A { }; | ||
55 | + | ||
56 | +static void g ( A && ) { } | ||
57 | + | ||
58 | +template < class T > class B { | ||
59 | +public: | ||
60 | + void f ( ) { | ||
61 | + A a; | ||
62 | + g ( std :: move ( a ) ); | ||
63 | + } | ||
64 | +}; | ||
65 | -- | ||
66 | 1.7.0.4 | ||
67 | |||