public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Fix port of NOP_EXPR
@ 2022-08-29 15:35 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-08-29 15:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a3e1361d1ac1ae892d25737e0ee21e71db423a07
commit a3e1361d1ac1ae892d25737e0ee21e71db423a07
Author: Philip Herron <philip.herron@embecosm.com>
Date: Tue Aug 23 17:42:17 2022 +0100
Fix port of NOP_EXPR
NOP_EXPR should fall through into convert and view_convert_exprs.
Diff:
---
gcc/rust/backend/rust-constexpr.cc | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc
index 36da7cb26ab..8c0f80b9e33 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-29 15:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29 15:35 [gcc/devel/rust/master] Fix port of NOP_EXPR Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).