This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Permit (_) on left hand side of =
- 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: Fri, 17 Feb 2012 15:37:00 -0800
- Subject: Go patch committed: Permit (_) on left hand side of =
- Authentication-results: mr.google.com; spf=pass (google.com: domain of iant@google.com designates 10.68.217.42 as permitted sender) smtp.mail=iant@google.com; dkim=pass header.i=iant@google.com
In an oversight, the gccgo frontend rejected valid Go code
(_) = 1
This patch fixes the problem. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r bcfd45b0bd55 go/parse.cc
--- a/go/parse.cc Fri Feb 17 15:19:05 2012 -0800
+++ b/go/parse.cc Fri Feb 17 15:35:16 2012 -0800
@@ -2491,7 +2491,7 @@
if (token->is_op(OPERATOR_LPAREN))
{
this->advance_token();
- ret = this->expression(PRECEDENCE_NORMAL, false, true, NULL);
+ ret = this->expression(PRECEDENCE_NORMAL, may_be_sink, true, NULL);
if (!this->peek_token()->is_op(OPERATOR_RPAREN))
error_at(this->location(), "missing %<)%>");
else