aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-macro.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-04-25 14:43:15 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:37:20 +0100
commitf5d02c4f5592b717a3aad5304308df913bf4ab1b (patch)
treee95c70e36d05336fdb8618a1cc9d6bb0d914124e /gcc/rust/ast/rust-macro.h
parent90effeedc48a187831ba71cabf616650c98a011b (diff)
downloadgcc-f5d02c4f5592b717a3aad5304308df913bf4ab1b.zip
gcc-f5d02c4f5592b717a3aad5304308df913bf4ab1b.tar.gz
gcc-f5d02c4f5592b717a3aad5304308df913bf4ab1b.tar.bz2
gccrs: ast: Add `outer_attrs` to all `Item`s
gcc/rust/ChangeLog: * ast/rust-ast.h: Add `outer_attrs` to Item. * ast/rust-expr.h: Make use of new inheritance methods. * ast/rust-item.h: Likewise. * ast/rust-macro.h: Likewise.
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r--gcc/rust/ast/rust-macro.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index bdf3eff..076ab97 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -541,8 +541,11 @@ public:
bool is_marked_for_strip () const override { return rule_name.empty (); }
// TODO: this mutable getter seems really dodgy. Think up better way.
- std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
- const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
+ std::vector<Attribute> &get_outer_attrs () override { return outer_attrs; }
+ const std::vector<Attribute> &get_outer_attrs () const override
+ {
+ return outer_attrs;
+ }
std::vector<MacroRule> &get_macro_rules () { return rules; }
const std::vector<MacroRule> &get_macro_rules () const { return rules; }
@@ -651,7 +654,10 @@ public:
return invoc_data.is_marked_for_strip ();
}
- const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
+ const std::vector<Attribute> &get_outer_attrs () const override
+ {
+ return outer_attrs;
+ }
std::vector<Attribute> &get_outer_attrs () override { return outer_attrs; }
void set_outer_attrs (std::vector<Attribute> new_attrs) override