diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-03-27 12:04:41 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-03-27 13:22:30 +0000 |
commit | 6c14a3b702b4fc693705a64674285900b2ec8b47 (patch) | |
tree | 2fe3b0f309d7e30d2be3d7dae2f503a035a5e35a /gcc/rust/backend/rust-compile-struct-field-expr.h | |
parent | 31ee9259a71742a455ead61c8b6142dcfab28b0f (diff) | |
download | gcc-6c14a3b702b4fc693705a64674285900b2ec8b47.zip gcc-6c14a3b702b4fc693705a64674285900b2ec8b47.tar.gz gcc-6c14a3b702b4fc693705a64674285900b2ec8b47.tar.bz2 |
gccrs: Fix ICE when compiling block expressions in array capacity
We need to reuse the existing compile_constant_item helper which handles
the case if this is a simple expression, fn-call or a block expression.
The patch extracts out this helper as a static method so this can be used
in more places.
Fixes Rust-GCC#3566
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc (HIRCompileBase::address_expression): new helper constexpr
* backend/rust-compile-base.h: prototype
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): call constexpr helper
gcc/testsuite/ChangeLog:
* rust/compile/issue-3566-1.rs: New test.
* rust/compile/issue-3566-2.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-struct-field-expr.h')
0 files changed, 0 insertions, 0 deletions