aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r--gcc/rust/ast/rust-expr.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 05c78b7..3463f5a 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -102,13 +102,7 @@ protected:
// Literal expression attribute body (non-macro attribute)
class AttrInputLiteral : public AttrInput
{
- // Literal expression WITHOUT SUFFIX
- // std::unique_ptr<LiteralExpr> literal_expr;
- LiteralExpr
- literal_expr; // as not using polymorphic behaviour, doesn't require pointer
- // TODO: will require pointer if LiteralExpr is changed to have subclassing
-
- // TODO: should this store location data?
+ LiteralExpr literal_expr;
public:
AttrInputLiteral (LiteralExpr lit_expr) : literal_expr (std::move (lit_expr))
@@ -127,6 +121,13 @@ public:
bool is_meta_item () const override { return false; }
+ LiteralExpr &get_literal () { return literal_expr; }
+
+ AttrInputType get_attr_input_type () const final override
+ {
+ return AttrInput::AttrInputType::LITERAL;
+ }
+
protected:
/* Use covariance to implement clone function as returning this object rather
* than base */