This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Fix type of discarded send expression


This patch to the Go frontend fixes the type of a discarded send
expression.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 4e92162e8594 go/expressions.cc
--- a/go/expressions.cc	Wed Mar 02 16:53:50 2011 -0800
+++ b/go/expressions.cc	Wed Mar 02 17:09:04 2011 -0800
@@ -12321,7 +12321,10 @@
 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]