summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch
new file mode 100644
index 0000000000..3e87c05e26
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0151-PR-c-46304.patch
@@ -0,0 +1,38 @@
1From 021acee3b7a6b26783c92870c1e202730c3f024e Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 20 Apr 2011 06:31:51 +0000
4Subject: [PATCH 151/200] PR c++/46304
5 * typeck.c (cp_build_binary_op): Fold COMPLEX_EXPR.
6
7git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172756 138bc75d-0d04-0410-961f-82ee72b054a4
8
9index ec9233d..dec0680 100644
10--- a/gcc/cp/typeck.c
11+++ b/gcc/cp/typeck.c
12@@ -4354,7 +4354,11 @@ cp_build_binary_op (location_t location,
13 gcc_unreachable();
14 }
15 }
16- return build2 (COMPLEX_EXPR, result_type, real, imag);
17+ real = fold_if_not_in_template (real);
18+ imag = fold_if_not_in_template (imag);
19+ result = build2 (COMPLEX_EXPR, result_type, real, imag);
20+ result = fold_if_not_in_template (result);
21+ return result;
22 }
23
24 /* For certain operations (which identify themselves by shorten != 0)
25new file mode 100644
26index 0000000..9d5463f
27--- /dev/null
28+++ b/gcc/testsuite/g++.dg/ext/complex7.C
29@@ -0,0 +1,6 @@
30+// { dg-options "" }
31+
32+class A
33+{
34+ static const _Complex double x = 1.0 + 2.0i;
35+};
36--
371.7.0.4
38