diff options
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index eed7308..bbb8ccf 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -769,23 +769,23 @@ register_constexpr_fundef (tree fun, tree body) if (!is_valid_constexpr_fn (fun, !DECL_GENERATED_P (fun))) return NULL; - body = massage_constexpr_body (fun, body); - if (body == NULL_TREE || body == error_mark_node) + tree massaged = massage_constexpr_body (fun, body); + if (massaged == NULL_TREE || massaged == error_mark_node) { if (!DECL_CONSTRUCTOR_P (fun)) error ("body of constexpr function %qD not a return-statement", fun); return NULL; } - if (!potential_rvalue_constant_expression (body)) + if (!potential_rvalue_constant_expression (massaged)) { if (!DECL_GENERATED_P (fun)) - require_potential_rvalue_constant_expression (body); + require_potential_rvalue_constant_expression (massaged); return NULL; } if (DECL_CONSTRUCTOR_P (fun) - && cx_check_missing_mem_inits (fun, body, !DECL_GENERATED_P (fun))) + && cx_check_missing_mem_inits (fun, massaged, !DECL_GENERATED_P (fun))) return NULL; /* Create the constexpr function table if necessary. */ @@ -1340,15 +1340,6 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t, { if (!result || result == error_mark_node) { - if (DECL_SAVED_TREE (fun) == NULL_TREE - && (DECL_CONSTRUCTOR_P (fun) || DECL_DESTRUCTOR_P (fun))) - /* The maybe-in-charge 'tor had its DECL_SAVED_TREE - cleared, try a clone. */ - for (fun = DECL_CHAIN (fun); - fun && DECL_CLONED_FUNCTION_P (fun); - fun = DECL_CHAIN (fun)) - if (DECL_SAVED_TREE (fun)) - break; gcc_assert (DECL_SAVED_TREE (fun)); tree parms, res; |