From 3c5283a738132562b7711278a09d3bd09239b7be Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 11 May 2011 17:30:10 -0400 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/semantics.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6452fd60c4e..961b8bfcfe3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-05-11 Jason Merrill + * 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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e12f03623e3..2e15800f3eb 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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); -- 2.30.2