PR c++/46304
* typeck.c (cp_build_binary_op): Fold COMPLEX_EXPR.
From-SVN: r172755
+2011-04-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/46304
+ * typeck.c (cp_build_binary_op): Fold COMPLEX_EXPR.
+
2011-04-19 Jason Merrill <jason@redhat.com>
PR c++/45267
gcc_unreachable();
}
}
- return build2 (COMPLEX_EXPR, result_type, real, imag);
+ real = fold_if_not_in_template (real);
+ imag = fold_if_not_in_template (imag);
+ result = build2 (COMPLEX_EXPR, result_type, real, imag);
+ result = fold_if_not_in_template (result);
+ return result;
}
/* For certain operations (which identify themselves by shorten != 0)
+2011-04-19 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/ext/complex7.C: New.
+
2011-04-19 Jason Merrill <jason@redhat.com>
* g++.dg/ext/attrib41.C: New.
--- /dev/null
+// { dg-options "" }
+
+class A
+{
+ static const _Complex double x = 1.0 + 2.0i;
+};