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 11:54:44 +0100 |
commit | b0d5b9f12adbce2c4a0df6059f5671188cd32293 (patch) | |
tree | f376fcd2e5dcc46185d73d619ce2eec31320d812 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch | |
parent | 81859b136c0153e8d5be71d56e910dcc3e8cdb66 (diff) | |
download | openembedded-core-contrib-b0d5b9f12adbce2c4a0df6059f5671188cd32293.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
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch new file mode 100644 index 0000000000..d890d92782 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0029-PR-c-47999.patch @@ -0,0 +1,57 @@ +From d1f71a5193dd2b3debd551f3dc0e0d237acf7e81 Mon Sep 17 00:00:00 2001 +From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Tue, 29 Mar 2011 14:25:37 +0000 +Subject: [PATCH 029/200] PR c++/47999 + * semantics.c (finish_call_expr): Preserve reference semantics + in templates. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171670 138bc75d-0d04-0410-961f-82ee72b054a4 + +index 3213483..23bb021 100644 +--- a/gcc/cp/semantics.c ++++ b/gcc/cp/semantics.c +@@ -2150,11 +2150,14 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual, + /* A call where the function is unknown. */ + result = cp_build_function_call_vec (fn, args, complain); + +- if (processing_template_decl) ++ if (processing_template_decl && result != error_mark_node) + { ++ if (TREE_CODE (result) == INDIRECT_REF) ++ result = TREE_OPERAND (result, 0); + result = build_call_vec (TREE_TYPE (result), orig_fn, orig_args); + KOENIG_LOOKUP_P (result) = koenig_p; + release_tree_vector (orig_args); ++ result = convert_from_reference (result); + } + + return result; +new file mode 100644 +index 0000000..66630e5 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/cpp0x/auto22.C +@@ -0,0 +1,21 @@ ++// PR c++/47999 ++// { dg-options -std=c++0x } ++ ++int& identity(int& i) ++{ ++ return i; ++} ++ ++// In a function template, auto type deduction works incorrectly. ++template <typename = void> ++void f() ++{ ++ int i = 0; ++ auto&& x = identity(i); // Type of x should be `int&`, but it is `int&&`. ++} ++ ++int main (int argc, char* argv[]) ++{ ++ f(); ++ return 0; ++} +-- +1.7.0.4 + |