diff options
author | Jason Merrill <jason@redhat.com> | 2011-05-11 17:30:10 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-05-11 17:30:10 -0400 |
commit | 3c5283a738132562b7711278a09d3bd09239b7be (patch) | |
tree | a4be4fd1abb3748131f72ffe15dd993481907f93 /gcc | |
parent | 9b41f0d3273a3a8561eebeec150357d80ed09819 (diff) | |
download | gcc-3c5283a738132562b7711278a09d3bd09239b7be.zip gcc-3c5283a738132562b7711278a09d3bd09239b7be.tar.gz gcc-3c5283a738132562b7711278a09d3bd09239b7be.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6452fd6..961b8bf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e12f036..2e15800 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); |