Commit 2ad8cf26 by Jason Merrill Committed by Jason Merrill

semantics.c (maybe_constant_value): Check instantiation_dependent_expression_p.

	* semantics.c (maybe_constant_value): Check
	instantiation_dependent_expression_p.
	* pt.c (build_non_dependent_expr): Don't check it here.

From-SVN: r197327
parent 879b0a1d
2013-04-01 Jason Merrill <jason@redhat.com> 2013-04-01 Jason Merrill <jason@redhat.com>
* semantics.c (maybe_constant_value): Check
instantiation_dependent_expression_p.
* pt.c (build_non_dependent_expr): Don't check it here.
PR c++/56772 PR c++/56772
* init.c (build_new): Don't try to process an array initializer * init.c (build_new): Don't try to process an array initializer
at template definition time. at template definition time.
......
...@@ -20444,8 +20444,7 @@ build_non_dependent_expr (tree expr) ...@@ -20444,8 +20444,7 @@ build_non_dependent_expr (tree expr)
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
/* Try to get a constant value for all non-dependent expressions in /* Try to get a constant value for all non-dependent expressions in
order to expose bugs in *_dependent_expression_p and constexpr. */ order to expose bugs in *_dependent_expression_p and constexpr. */
if (cxx_dialect >= cxx0x if (cxx_dialect >= cxx0x)
&& !instantiation_dependent_expression_p (expr))
maybe_constant_value (fold_non_dependent_expr_sfinae (expr, tf_none)); maybe_constant_value (fold_non_dependent_expr_sfinae (expr, tf_none));
#endif #endif
......
...@@ -8270,11 +8270,10 @@ maybe_constant_value (tree t) ...@@ -8270,11 +8270,10 @@ maybe_constant_value (tree t)
{ {
tree r; tree r;
if (type_dependent_expression_p (t) if (instantiation_dependent_expression_p (t)
|| type_unknown_p (t) || type_unknown_p (t)
|| BRACE_ENCLOSED_INITIALIZER_P (t) || BRACE_ENCLOSED_INITIALIZER_P (t)
|| !potential_constant_expression (t) || !potential_constant_expression (t))
|| value_dependent_expression_p (t))
{ {
if (TREE_OVERFLOW_P (t)) if (TREE_OVERFLOW_P (t))
{ {
......
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