aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-01-13 21:14:28 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-01-16 14:07:50 +0000
commitd96e1594dd378078987900819afc611bd0db19b0 (patch)
tree7105c8abfaaabe2dbd997aee37e13fe0bed860c4 /gcc/rust/resolve/rust-ast-resolve-expr.h
parent05b9f235566d7d361709c5bc44e7c36598515946 (diff)
downloadgcc-d96e1594dd378078987900819afc611bd0db19b0.zip
gcc-d96e1594dd378078987900819afc611bd0db19b0.tar.gz
gcc-d96e1594dd378078987900819afc611bd0db19b0.tar.bz2
This brings in resolution and type checking of the unit-type.
It is possible to assign and declare variables of unit-type which translate down to zero sized void_type_node. More work is needed to handle array and ADT types using unit-type when emiting gimple. The name+type resolution should be generic enough.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-expr.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h
index 324d820..abab268 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.h
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.h
@@ -35,7 +35,13 @@ public:
expr->accept_vis (resolver);
};
- ~ResolveExpr () {}
+ void visit (AST::TupleExpr &expr)
+ {
+ if (expr.is_unit ())
+ return;
+
+ gcc_unreachable ();
+ }
void visit (AST::PathInExpression &expr)
{