PR c++/55753
* tree.c (build_aggr_init_expr): Do nothing in a template.
* pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
a FUNCTION_DECL before tsubsting.
From-SVN: r194986
+2013-01-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/55753
+ * tree.c (build_aggr_init_expr): Do nothing in a template.
+ * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
+ a FUNCTION_DECL before tsubsting.
+
2013-01-04 Dodji Seketeli <dodji@redhat.com>
PR c++/52343
else
qualified_p = false;
+ if (TREE_CODE (function) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL)
+ /* Avoid error about taking the address of a constructor. */
+ function = TREE_OPERAND (function, 0);
+
function = tsubst_copy_and_build (function, args, complain,
in_decl,
!qualified_p,
tree rval;
int is_ctor;
+ /* Don't build AGGR_INIT_EXPR in a template. */
+ if (processing_template_decl)
+ return init;
+
if (TREE_CODE (init) == CALL_EXPR)
fn = CALL_EXPR_FN (init);
else if (TREE_CODE (init) == AGGR_INIT_EXPR)
--- /dev/null
+// PR c++/55753
+// { dg-options -std=c++11 }
+
+struct A
+{
+ double r,i;
+ constexpr A(double r = 0.0, double i = 0.0): r(r), i(i) {}
+};
+
+template <typename Tp>
+struct B {
+ B() {
+ A((true ? 1.0 : A()));
+ }
+};