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.
/* 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;
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;
}
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);