From a3e1361d1ac1ae892d25737e0ee21e71db423a07 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 23 Aug 2022 17:42:17 +0100 Subject: Fix port of NOP_EXPR NOP_EXPR should fall through into convert and view_convert_exprs. --- gcc/rust/backend/rust-constexpr.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'gcc/rust/backend') diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc index 36da7cb..8c0f80b 100644 --- a/gcc/rust/backend/rust-constexpr.cc +++ b/gcc/rust/backend/rust-constexpr.cc @@ -2080,15 +2080,6 @@ eval_constant_expression (const constexpr_ctx *ctx, tree t, bool lval, non_constant_p, overflow_p); break; - case NOP_EXPR: - if (REINTERPRET_CAST_P (t)) - { - if (!ctx->quiet) - error_at (loc, "% is not a constant expression"); - *non_constant_p = true; - return t; - } - /* FALLTHROUGH. */ case MODIFY_EXPR: r = eval_store_expression (ctx, t, false, non_constant_p, overflow_p); break; @@ -2347,6 +2338,7 @@ eval_constant_expression (const constexpr_ctx *ctx, tree t, bool lval, break; /* FALLTHROUGH. */ + case NOP_EXPR: case CONVERT_EXPR: case VIEW_CONVERT_EXPR: { tree oldop = TREE_OPERAND (t, 0); -- cgit v1.1