aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-24 17:11:59 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-08-01 16:52:27 +0200
commit7f0763069f9d4bbd851623889d59c4d91758f60b (patch)
treee375dfc1a0ff2352c38cb39109165ae4bd531424 /gcc
parente47d270c0d51d7865a8cf2575ffab46352db371b (diff)
downloadgcc-7f0763069f9d4bbd851623889d59c4d91758f60b.zip
gcc-7f0763069f9d4bbd851623889d59c4d91758f60b.tar.gz
gcc-7f0763069f9d4bbd851623889d59c4d91758f60b.tar.bz2
gccrs: Add constant identifiers to the value namespace
Constants could not be resolved without their identifier in the right scope. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Add constant identifiers to the resolver. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index b672d44..f65ec77 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -401,6 +401,9 @@ TopLevel::visit (AST::Union &union_item)
void
TopLevel::visit (AST::ConstantItem &const_item)
{
+ insert_or_error_out (const_item.get_identifier (), const_item,
+ Namespace::Values);
+
auto expr_vis
= [this, &const_item] () { const_item.get_expr ().accept_vis (*this); };