]> gcc.gnu.org Git - gcc.git/commitdiff
gccrs: Visit constant item type in default resolver
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 24 Jan 2024 15:50:27 +0000 (16:50 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Aug 2024 14:52:26 +0000 (16:52 +0200)
The type of constant item expression was not properly visited in the
default resolver.

gcc/rust/ChangeLog:

* resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
constant item's types.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/resolve/rust-default-resolver.cc

index d805bc9a511d5d8d4d518ac9ade31f30db68757c..0c2576f6e755a9033ac63232d3d582cf2546b4bb 100644 (file)
@@ -464,7 +464,10 @@ DefaultResolver::visit (AST::EnumItemDiscriminant &item)
 void
 DefaultResolver::visit (AST::ConstantItem &item)
 {
-  auto expr_vis = [this, &item] () { item.get_expr ().accept_vis (*this); };
+  auto expr_vis = [this, &item] () {
+    item.get_expr ().accept_vis (*this);
+    visit (item.get_type ());
+  };
 
   // FIXME: Why do we need a Rib here?
   ctx.scoped (Rib::Kind::Item, item.get_node_id (), expr_vis);
This page took 0.069136 seconds and 5 git commands to generate.