Commit 1a288768 by Jason Merrill Committed by Jason Merrill

re PR c++/56998 (ICE in value_dependent_expression_p, at cp/pt.c:19598)

	PR c++/56998
	* semantics.c (potential_constant_expression_1): Make sure the
	called function is potentially constant.
	* call.c (null_ptr_cst_p): Revert earlier change.

From-SVN: r198881
parent d4c52634
2013-05-14 Jason Merrill <jason@redhat.com>
PR c++/56998
* semantics.c (potential_constant_expression_1): Make sure the
called function is potentially constant.
* call.c (null_ptr_cst_p): Revert earlier change.
2013-05-13 Jason Merrill <jason@redhat.com> 2013-05-13 Jason Merrill <jason@redhat.com>
PR c++/56998 PR c++/56998
......
...@@ -554,7 +554,7 @@ null_ptr_cst_p (tree t) ...@@ -554,7 +554,7 @@ null_ptr_cst_p (tree t)
if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t))) if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)))
{ {
/* Core issue 903 says only literal 0 is a null pointer constant. */ /* Core issue 903 says only literal 0 is a null pointer constant. */
if (cxx_dialect < cxx0x && !TREE_SIDE_EFFECTS (t)) if (cxx_dialect < cxx0x)
t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none)); t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none));
STRIP_NOPS (t); STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t)) if (integer_zerop (t) && !TREE_OVERFLOW (t))
......
...@@ -8476,7 +8476,11 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) ...@@ -8476,7 +8476,11 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
} }
} }
else else
fun = get_first_fn (fun); {
if (!potential_constant_expression_1 (fun, true, flags))
return false;
fun = get_first_fn (fun);
}
/* Skip initial arguments to base constructors. */ /* Skip initial arguments to base constructors. */
if (DECL_BASE_CONSTRUCTOR_P (fun)) if (DECL_BASE_CONSTRUCTOR_P (fun))
i = num_artificial_parms_for (fun); i = num_artificial_parms_for (fun);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment