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
This commit is contained in:
Jason Merrill 2011-05-11 17:30:10 -04:00 committed by Jason Merrill
parent 9b41f0d327
commit 3c5283a738
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
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.
(validate_constexpr_fundecl): Not here.

View File

@ -5462,7 +5462,7 @@ validate_constexpr_fundecl (tree fun)
/* We already checked the original function. */
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;
return NULL;
@ -5732,7 +5732,7 @@ register_constexpr_fundef (tree fun, tree body)
if (!potential_rvalue_constant_expression (body))
{
DECL_DECLARED_CONSTEXPR_P (fun) = false;
if (!DECL_TEMPLATE_INSTANTIATION (fun))
if (!DECL_TEMPLATE_INFO (fun))
require_potential_rvalue_constant_expression (body);
return NULL;
}
@ -6076,7 +6076,7 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t,
if (!allow_non_constant)
{
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_TI_TEMPLATE (fun))))
is_valid_constexpr_fn (fun, true);