diff options
Diffstat (limited to 'gcc/rust/backend/rust-constexpr.cc')
-rw-r--r-- | gcc/rust/backend/rust-constexpr.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc index bfd7d95..dc2d6b1 100644 --- a/gcc/rust/backend/rust-constexpr.cc +++ b/gcc/rust/backend/rust-constexpr.cc @@ -2697,10 +2697,8 @@ eval_store_expression (const constexpr_ctx *ctx, tree t, bool lval, } if (TREE_CODE (probe) == ARRAY_REF) { - // TODO - rust_unreachable (); - // elt = eval_and_check_array_index (ctx, probe, false, - // non_constant_p, overflow_p); + elt = eval_and_check_array_index (ctx, probe, false, + non_constant_p, overflow_p); if (*non_constant_p) return t; } @@ -2929,8 +2927,13 @@ eval_store_expression (const constexpr_ctx *ctx, tree t, bool lval, } } + if (*non_constant_p) + return t; + /* Don't share a CONSTRUCTOR that might be changed later. */ init = unshare_constructor (init); + if (init == NULL_TREE) + return t; if (*valp && TREE_CODE (*valp) == CONSTRUCTOR && TREE_CODE (init) == CONSTRUCTOR) @@ -3585,9 +3588,6 @@ eval_call_expression (const constexpr_ctx *ctx, tree t, bool lval, result = *ctx->global->values.get (res); if (result == NULL_TREE && !*non_constant_p) { - if (!ctx->quiet) - error ("%<constexpr%> call flows off the end " - "of the function"); *non_constant_p = true; } } |