diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-03-14 17:08:07 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-03-17 15:51:06 +0100 |
commit | 1a2ef9cae90db5bdb18723b6adafe2750a95ed76 (patch) | |
tree | c634ec46956c01a631ba528854975b45b82739a7 /gcc/rust/ast/rust-macro.h | |
parent | 1a14348afefc62313e38156fde768744378f9ebf (diff) | |
download | gcc-1a2ef9cae90db5bdb18723b6adafe2750a95ed76.zip gcc-1a2ef9cae90db5bdb18723b6adafe2750a95ed76.tar.gz gcc-1a2ef9cae90db5bdb18723b6adafe2750a95ed76.tar.bz2 |
macros: Add remaining context and improve parsing macro dispatch
This allows us to expand macor invocations in more places, as macro
calls are not limited to statements or expressions. It is quite common
to use macros to abstract writing repetitive boilerplate for type
implementations, for example.
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r-- | gcc/rust/ast/rust-macro.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h index 1c5d102..5ecd5d7 100644 --- a/gcc/rust/ast/rust-macro.h +++ b/gcc/rust/ast/rust-macro.h @@ -460,6 +460,7 @@ class MacroInvocation : public TypeNoBounds, public TraitItem, public TraitImplItem, public InherentImplItem, + public ExternalItem, public ExprWithoutBlock { std::vector<Attribute> outer_attrs; @@ -537,6 +538,11 @@ protected: return clone_macro_invocation_impl (); } + MacroInvocation *clone_external_item_impl () const final override + { + return clone_macro_invocation_impl (); + } + /*virtual*/ MacroInvocation *clone_macro_invocation_impl () const { return new MacroInvocation (*this); |