aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-11-18 12:07:24 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-11-18 12:07:24 -0500
commitde6147508bdf9f319ad246031e58a9983461034e (patch)
tree53b4559d47a26ddc6ee87eb8ea55094d828dba04 /gcc
parent5d2d755e862d70f29ba26ad71c563de35ec230de (diff)
downloadgcc-de6147508bdf9f319ad246031e58a9983461034e.zip
gcc-de6147508bdf9f319ad246031e58a9983461034e.tar.gz
gcc-de6147508bdf9f319ad246031e58a9983461034e.tar.bz2
re PR c++/63934 ([C++] internal compiler error: in adjust_temp_type, at cp/constexpr.c:1020)
PR c++/63934 * constexpr.c (cxx_eval_call_expression): Check DECL_CONSTRUCTOR_P rather than VOID_TYPE_P. From-SVN: r217729
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/constexpr.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1173559..28d8796 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 2f0708b..4325caa 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -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);