diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-11-16 15:18:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 15:18:49 +0000 |
commit | 5514d9cec51d5ec7cc30dd6cdbfadfdddbe0aab3 (patch) | |
tree | 55051cad7f474f411d79ca1e86cc23d63138716d /gcc/rust/resolve/rust-ast-verify-assignee.h | |
parent | dcd758595f646a480947265ccc9833fdd3976b75 (diff) | |
parent | 6d1333ef46cba6ed9e1ace817f9cc649b7f7a1df (diff) | |
download | gcc-5514d9cec51d5ec7cc30dd6cdbfadfdddbe0aab3.zip gcc-5514d9cec51d5ec7cc30dd6cdbfadfdddbe0aab3.tar.gz gcc-5514d9cec51d5ec7cc30dd6cdbfadfdddbe0aab3.tar.bz2 |
Merge #801
801: operator overloading r=philberty a=philberty
This change adds operator overloading by following how the C++ front-end
does it. We are relying on GCC to inline the operator overloads which does
occur once optimizations are enabled. It also brings back the desurgared
compound assignment expression (e2b761b13e6ccd3a7af4100183bb13e32b5b0da0)
for lang_items such as add_assign. You can find more information on how the algorithm works in:
- c47d5cbdee9b701fb7753b44530fcb51f80b20fa
- a7fb60bb626f7b936bf117636db777a5f0df30c9
These were refactored in: 0f74fe23c6d602c257ba94b2522bd9d6a594609e
Fixes #249
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-verify-assignee.h')
-rw-r--r-- | gcc/rust/resolve/rust-ast-verify-assignee.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-verify-assignee.h b/gcc/rust/resolve/rust-ast-verify-assignee.h index 6fbf5fe..d362fe4 100644 --- a/gcc/rust/resolve/rust-ast-verify-assignee.h +++ b/gcc/rust/resolve/rust-ast-verify-assignee.h @@ -75,6 +75,13 @@ public: } } + void visit (AST::DereferenceExpr &expr) override + { + expr.get_dereferenced_expr ()->accept_vis (*this); + } + + void visit (AST::PathInExpression &expr) override { ok = true; } + private: VerifyAsignee (NodeId parent) : ResolverBase (parent), ok (false) {} |