aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-24 17:11:59 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-03-26 17:35:02 +0000
commitb0f27e8d81f241d66300a066ac6a133c6347ae4f (patch)
tree546046369dea1e9fb93f19f24b88a2551f5a5599 /gcc
parent01f3f7b846504858c43a5d94b9d60109369648e1 (diff)
downloadgcc-b0f27e8d81f241d66300a066ac6a133c6347ae4f.zip
gcc-b0f27e8d81f241d66300a066ac6a133c6347ae4f.tar.gz
gcc-b0f27e8d81f241d66300a066ac6a133c6347ae4f.tar.bz2
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); };