From patchwork Wed Dec 5 01:09:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 203748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C438C2C00A3 for ; Wed, 5 Dec 2012 12:10:15 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355274616; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=1SpAvWP Vnp8/VbUSzxyWTEEwBq8=; b=KVLxrxjKVaIzp6Q3E+g/n+jXveqSmkF5VJCK8aY rJ9lbbZ/FwIVNV40wsgnc5MvFzWk5r+ZBDonGiV5j3PG6uAc/Td5716/O0m3yC1z 8FEo+cunZ5frnwPI9ZgVLhfZhPMFVeC9Jr4w/u/qFUfvBvRO8trbXHb1z3NTMdoC OTOc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=hmYunZnrjC8qeoLkm7SnaK0Js65UTSlri3QqXweYbXZH5kCa24DS0XqpQxC6iW L1H1hFBdhNbdW3wFd5fF5OpdLzc3QlbSWMqwuYW67gGqa1C2JPyswvEweNx93Zuw UUVukNH6GiQLM1C+h0hV7KBPRfPUravR3/cPp8EqUcUMA=; Received: (qmail 28607 invoked by alias); 5 Dec 2012 01:10:08 -0000 Received: (qmail 28572 invoked by uid 22791); 5 Dec 2012 01:10:07 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Dec 2012 01:10:02 +0000 Received: by mail-pb0-f47.google.com with SMTP id un1so2940374pbc.20 for ; Tue, 04 Dec 2012 17:10:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=anAPq/hKaSDyoLByvd0vH0881x77ZMIAm78MZxX4/ZA=; b=EbLS41f9DUcRFy3CrY1cCBi7CaTp29/yxTC/rwu5HizkCYsbinFOiphaMh5eRpcJSo BlCnX2HLz2UkaOA9+hWgxIY9dJOenvdGhAwwVMWqCVeqWFPXpXGJ0Yn4/e0UoC3imgH6 vRJvAb3PGV6Bcqms8aoLsJbW4jBL6cZNKHORMibPzzC0nCIuUIXKmr/k3r7Jnp17P/T7 sW9CxmjdVrU/duH99cFPkaWrLsRC6cf+l7SHjSq/Gw97n6o4TMq0tcsUAkfeyuo4ATUR m7rNDzdCyfFgoyqfNl9BdqZ3zp7WXSzcSswM4kd7h+zhQZ08Wwg5JShZQdrrWZ/vruzQ MeHg== Received: by 10.66.79.194 with SMTP id l2mr39682755pax.68.1354669802275; Tue, 04 Dec 2012 17:10:02 -0800 (PST) Received: from coign.google.com ([2401:fa00:0:9:224:d7ff:fe8f:f634]) by mx.google.com with ESMTPS id x2sm1676597paw.8.2012.12.04.17.09.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Dec 2012 17:10:01 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Accept comma after expression in type conversion Date: Tue, 04 Dec 2012 17:09:56 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlRPDLrfgQ+5VALpw/i4ZDQubws1Z8o2Js25EFxZ4vVCVRWCDgk8GdiAKW8tevkuNwi33oxRTwtZDMjjMTW771H2MiRPW8XNESOCN76pnSXbxN+pGc51XNCz+mQZgSuMIgbt4uIHeTZfhpgqJfl1MhSWpQ/9Zy3yu9dDP+jPXIwkjiXicnXcZH8G19UKCV9Ni+fs2to X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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(),