re PR c++/63934 ([C++] internal compiler error: in adjust_temp_type, at cp/constexpr...
authorJason Merrill <jason@redhat.com>
Tue, 18 Nov 2014 17:07:24 +0000 (12:07 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 18 Nov 2014 17:07:24 +0000 (12:07 -0500)
PR c++/63934
* constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
rather than VOID_TYPE_P.

From-SVN: r217729

gcc/cp/ChangeLog
gcc/cp/constexpr.c

index 117355975fa2de56d049ba911f55bcadc243c020..28d8796842d6e52ef55a7c73532625a82ae14ac9 100644 (file)
@@ -1,5 +1,9 @@
 2014-11-18  Jason Merrill  <jason@redhat.com>
 
+       PR c++/63934
+       * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P
+       rather than VOID_TYPE_P.
+
        * pt.c (instantiate_template_1): Use tsubst_aggr_type for context.
 
        PR c++/58102
index 2f0708b40ec3180f5845036abac22ddcac4e4958..4325caa0672d5eac7535724dba0b7b7795b5c6f8 100644 (file)
@@ -1328,7 +1328,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
@@ -1367,7 +1367,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);