From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85560 invoked by alias); 22 Aug 2018 13:07:41 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 85038 invoked by uid 89); 22 Aug 2018 13:07:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=uhr, 2f484479c741abddc8ac473cb0c1b9010397e006, H*i:sk:CAKwh3q, posterity X-HELO: mail-wr1-f51.google.com Received: from mail-wr1-f51.google.com (HELO mail-wr1-f51.google.com) (209.85.221.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Aug 2018 13:07:39 +0000 Received: by mail-wr1-f51.google.com with SMTP id u12-v6so295838wrr.4; Wed, 22 Aug 2018 06:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:in-reply-to:references:mime-version:content-transfer-encoding :subject:to:from:message-id; bh=AHMCqmCRdYVlXpKaVBnGP02u2OoRyMYmOEcKrbi698A=; b=fC7xyi1Pw8469gQtg6ppeTmIue8mX531PLfn0To2LkpPjLl2Xd0M99ILqu3evI7d1W iSchZMaqCtESsMurL0m4AyYUTL5MWJdqyC9lyZXqe1y9rtq0GpivRBDhPUvrJXwwUUc+ zTdVIEWwy1V1YBFY9mRzBByakAE1OkmKhsIaRLeNp15yA1Gybsog8CR27NDRwVO40aK9 0oGUv4L1Y0IER+Pj7royULc0MnGTGjObPbu7u+lBSUZIR+u7c7X6KL95z8aX9muntl7J 0EqB+xLZGpnUANH+2zdWGbM6NA827Lh5vCt5Vj7WuTLBQoU6s1rY4I5/S+RHsabcL6Y9 DY7g== Return-Path: Received: from s49-gx7-B.weghof (217-149-168-171.nat.highway.telekom.at. [217.149.168.171]) by smtp.gmail.com with ESMTPSA id r6-v6sm1328431wrt.92.2018.08.22.06.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 06:07:36 -0700 (PDT) Date: Wed, 22 Aug 2018 13:07:00 -0000 In-Reply-To: References: <9F1BA124-0E74-496E-9AAC-53C86052CF5F@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Patch, Fortran] PR 86935: Bad locus in ASSOCIATE statement To: Janus Weil ,gfortran From: Bernhard Reutner-Fischer Message-ID: X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00083.txt.bz2 On 21 August 2018 18:20:08 CEST, Janus Weil wrote: >ping! > > >Am Di., 14. Aug. 2018 um 21:40 Uhr schrieb Janus Weil >: >> >> > > >> > >this simple patch improves some of the diagnostics for invalid >> > >ASSOCIATE statements: >> > > >> > >>https://github.com/janusw/gcc/commit/2f484479c741abddc8ac473cb0c1b9010397= e006 >> > >> > Please do not send external references but the patch itself for >posterity. >> >> "git diff pr86935~1 pr86935 > pr86935.diff" >> See attachment. +++ b/gcc/fortran/match.c @@ -1889,15 +1889,19 @@ gfc_match_associate (void) gfc_association_list* a; =20 /* Match the next association. */ - if (gfc_match (" %n =3D> %e", newAssoc->name, &newAssoc->target) - !=3D MATCH_YES) + if (gfc_match (" %n =3D> ", newAssoc->name) !=3D MATCH_YES) Since you match " %e", I.e. with leading optional space, I'd omit the trail= ing blank in " %n =3D> ". With that change the patch looks ok to me, but I cannot approve it. Cheers, + { + gfc_error ("Expected association at %C"); + goto assocListError; + } + + if (gfc_match (" %e", &newAssoc->target) !=3D MATCH_YES) {