diff mbox

Go patch committed: Permit (_) on left hand side of =

Message ID mcr8vk1xc9v.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Feb. 17, 2012, 11:37 p.m. UTC
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 mbox

Patch

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