This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Fix type of discarded send expression
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Wed, 02 Mar 2011 17:17:39 -0800
- Subject: 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.