diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-04 05:17:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-12-04 05:17:54 +0000 |
commit | 3f7af571aa8bcd3707843c413b2baa06bbe46ff3 (patch) | |
tree | fc45f7b721523284e00758f9174c0e8d2878b20d /gcc/go/gofrontend/expressions.h | |
parent | 114d8843e607fd4856c2a35741a80cddb965f278 (diff) | |
download | gcc-3f7af571aa8bcd3707843c413b2baa06bbe46ff3.zip gcc-3f7af571aa8bcd3707843c413b2baa06bbe46ff3.tar.gz gcc-3f7af571aa8bcd3707843c413b2baa06bbe46ff3.tar.bz2 |
compiler: Fix crash in go/defer of some builtin functions.
From-SVN: r194114
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index eb4406d..66e05a7 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -360,10 +360,11 @@ class Expression // This is called if the value of this expression is being // discarded. This issues warnings about computed values being - // unused. - void + // unused. This returns true if all is well, false if it issued an + // error message. + bool discarding_value() - { this->do_discarding_value(); } + { return this->do_discarding_value(); } // Return whether this is an error expression. bool @@ -689,7 +690,7 @@ class Expression { return false; } // Called by the parser if the value is being discarded. - virtual void + virtual bool do_discarding_value(); // Child class holds type. @@ -1205,7 +1206,7 @@ class Binary_expression : public Expression bool do_numeric_constant_value(Numeric_constant*) const; - void + bool do_discarding_value(); Type* @@ -1373,9 +1374,9 @@ class Call_expression : public Expression virtual Expression* do_lower(Gogo*, Named_object*, Statement_inserter*, int); - void + bool do_discarding_value() - { } + { return true; } virtual Type* do_type(); @@ -2056,9 +2057,9 @@ class Receive_expression : public Expression do_traverse(Traverse* traverse) { return Expression::traverse(&this->channel_, traverse); } - void + bool do_discarding_value() - { } + { return true; } Type* do_type(); |