Fix type of discarded send expression.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 01:17:34 +0000 (01:17 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 3 Mar 2011 01:17:34 +0000 (01:17 +0000)
From-SVN: r170634

gcc/go/gofrontend/expressions.cc

index ee486ffb27a79d5b3107e7a1785b05ad25774330..a45e7acc247bbcfa5d7eaf4c87af68d21fb6c2f6 100644 (file)
@@ -12321,7 +12321,10 @@ Send_expression::do_traverse(Traverse* traverse)
 Type*
 Send_expression::do_type()
 {
-  return Type::lookup_bool_type();
+  if (this->is_value_discarded_)
+    return Type::make_void_type();
+  else
+    return Type::lookup_bool_type();
 }
 
 // Set types.