]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add constant identifiers to the value namespace
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 24 Jan 2024 16:11:59 +0000 (17:11 +0100)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 26 Mar 2024 17:35:02 +0000 (17:35 +0000)
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>
gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc

index b672d448151ae6088dd436bcb17bb177196e4459..f65ec77331ceb5ddce2de7b1e3c5d857b92c264b 100644 (file)
@@ -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); };