Commit 3c5283a7 by Jason Merrill Committed by Jason Merrill

semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO rather than…

semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO rather than DECL_TEMPLATE_INSTANTIATION.

	* semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO
	rather than DECL_TEMPLATE_INSTANTIATION.
	(cxx_eval_call_expression): Likewise.

From-SVN: r173682
parent 9b41f0d3
2011-05-11 Jason Merrill <jason@redhat.com> 2011-05-11 Jason Merrill <jason@redhat.com>
* semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO
rather than DECL_TEMPLATE_INSTANTIATION.
(cxx_eval_call_expression): Likewise.
* semantics.c (register_constexpr_fundef): Add to hash table here. * semantics.c (register_constexpr_fundef): Add to hash table here.
(validate_constexpr_fundecl): Not here. (validate_constexpr_fundecl): Not here.
......
...@@ -5462,7 +5462,7 @@ validate_constexpr_fundecl (tree fun) ...@@ -5462,7 +5462,7 @@ validate_constexpr_fundecl (tree fun)
/* We already checked the original function. */ /* We already checked the original function. */
return fun; return fun;
if (!is_valid_constexpr_fn (fun, !DECL_TEMPLATE_INSTANTIATION (fun))) if (!is_valid_constexpr_fn (fun, !DECL_TEMPLATE_INFO (fun)))
{ {
DECL_DECLARED_CONSTEXPR_P (fun) = false; DECL_DECLARED_CONSTEXPR_P (fun) = false;
return NULL; return NULL;
...@@ -5732,7 +5732,7 @@ register_constexpr_fundef (tree fun, tree body) ...@@ -5732,7 +5732,7 @@ register_constexpr_fundef (tree fun, tree body)
if (!potential_rvalue_constant_expression (body)) if (!potential_rvalue_constant_expression (body))
{ {
DECL_DECLARED_CONSTEXPR_P (fun) = false; DECL_DECLARED_CONSTEXPR_P (fun) = false;
if (!DECL_TEMPLATE_INSTANTIATION (fun)) if (!DECL_TEMPLATE_INFO (fun))
require_potential_rvalue_constant_expression (body); require_potential_rvalue_constant_expression (body);
return NULL; return NULL;
} }
...@@ -6076,7 +6076,7 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t, ...@@ -6076,7 +6076,7 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t,
if (!allow_non_constant) if (!allow_non_constant)
{ {
error_at (loc, "%qD is not a constexpr function", fun); error_at (loc, "%qD is not a constexpr function", fun);
if (DECL_TEMPLATE_INSTANTIATION (fun) if (DECL_TEMPLATE_INFO (fun)
&& DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT && DECL_DECLARED_CONSTEXPR_P (DECL_TEMPLATE_RESULT
(DECL_TI_TEMPLATE (fun)))) (DECL_TI_TEMPLATE (fun))))
is_valid_constexpr_fn (fun, true); is_valid_constexpr_fn (fun, true);
......
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