From b0f27e8d81f241d66300a066ac6a133c6347ae4f Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 24 Jan 2024 17:11:59 +0100 Subject: 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 --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc') 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); }; -- cgit v1.1