public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Accept comma after expression in type conversion
@ 2012-12-05  1:10 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2012-12-05  1:10 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

The Go language accepts an optional comma after an expression in a type
conversion.  This is because type conversions can look like function
calls.  The Go frontend was incorrectly rejecting these valid programs.
This patch fixes that.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline and 4.7 branch.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 448 bytes --]

diff -r 76d51e7d9209 go/parse.cc
--- a/go/parse.cc	Tue Dec 04 16:52:53 2012 -0800
+++ b/go/parse.cc	Tue Dec 04 17:04:39 2012 -0800
@@ -2979,6 +2979,8 @@
 	  this->advance_token();
 	  Expression* expr = this->expression(PRECEDENCE_NORMAL, false, true,
 					      NULL);
+	  if (this->peek_token()->is_op(OPERATOR_COMMA))
+	    this->advance_token();
 	  if (this->peek_token()->is_op(OPERATOR_ELLIPSIS))
 	    {
 	      error_at(this->location(),

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-05  1:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-05  1:10 Go patch committed: Accept comma after expression in type conversion Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).