aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-constexpr.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-08-23 17:42:17 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-08-25 12:40:28 +0100
commita3e1361d1ac1ae892d25737e0ee21e71db423a07 (patch)
treeac5f73c594e15ad6943b7e8da0587212f7dac502 /gcc/rust/backend/rust-constexpr.cc
parent5a8f2fd653afe2e60672678d9cbfe0fa8a5e4124 (diff)
downloadgcc-a3e1361d1ac1ae892d25737e0ee21e71db423a07.zip
gcc-a3e1361d1ac1ae892d25737e0ee21e71db423a07.tar.gz
gcc-a3e1361d1ac1ae892d25737e0ee21e71db423a07.tar.bz2
Fix port of NOP_EXPR
NOP_EXPR should fall through into convert and view_convert_exprs.
Diffstat (limited to 'gcc/rust/backend/rust-constexpr.cc')
-rw-r--r--gcc/rust/backend/rust-constexpr.cc10
1 files changed, 1 insertions, 9 deletions
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, "%<reinterpret_cast%> 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);