On ARM constructors return a pointer, so the test for void return
breaks. We also don't need to mess with the CONSTRUCTOR we built up in
the new scheme.
Tested x86_64-pc-linux-gnu, applying to trunk.
commit ddfea2b5af06860433d32ad440673c2df37dc8f1
Author: Jason Merrill <ja...@redhat.com>
Date: Tue Nov 18 11:14:22 2014 -0500
PR c++/63934
* constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
rather than VOID_TYPE_P.
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 67d039e..691dd78 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -1327,7 +1327,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
addr, non_constant_p, overflow_p,
&jump_target);
- if (VOID_TYPE_P (TREE_TYPE (res)))
+ if (DECL_CONSTRUCTOR_P (fun))
/* This can be null for a subobject constructor call, in
which case what we care about is the initialization
side-effects rather than the value. We could get at the
@@ -1366,7 +1366,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
{
/* If this was a call to initialize an object, set the type of
the CONSTRUCTOR to the type of that object. */
- if (DECL_CONSTRUCTOR_P (fun))
+ if (DECL_CONSTRUCTOR_P (fun) && !use_new_call)
{
tree ob_arg = get_nth_callarg (t, 0);
STRIP_NOPS (ob_arg);