summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch
new file mode 100644
index 0000000000..b08e4b3725
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0338-PR-c-46696.patch
@@ -0,0 +1,48 @@
1From c2acb441c539c4d3c307166def3c3c779cdccf43 Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 25 May 2011 20:29:47 +0000
4Subject: [PATCH] PR c++/46696
5 * typeck.c (cp_build_modify_expr): Check DECL_DEFAULTED_FN.
6
7git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174233 138bc75d-0d04-0410-961f-82ee72b054a4
8
9index 578eb83..2022f0f 100644
10--- a/gcc/cp/typeck.c
11+++ b/gcc/cp/typeck.c
12@@ -6727,7 +6727,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
13
14 /* Allow array assignment in compiler-generated code. */
15 else if (!current_function_decl
16- || !DECL_ARTIFICIAL (current_function_decl))
17+ || !DECL_DEFAULTED_FN (current_function_decl))
18 {
19 /* This routine is used for both initialization and assignment.
20 Make sure the diagnostic message differentiates the context. */
21new file mode 100644
22index 0000000..5fcf5b0
23--- /dev/null
24+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted29.C
25@@ -0,0 +1,20 @@
26+// PR c++/46696
27+// { dg-options -std=c++0x }
28+
29+struct A
30+{
31+ A& operator= (A const&);
32+};
33+
34+struct B
35+{
36+ A ar[1];
37+ B& operator= (B const&) = default;
38+};
39+
40+int main()
41+{
42+ B x;
43+ B y;
44+ y = x;
45+}
46--
471.7.0.4
48