From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from impout007.msg.chrl.nc.charter.net (impout007aa.msg.chrl.nc.charter.net [47.43.20.31]) by sourceware.org (Postfix) with ESMTPS id 6AEFC38708CE for ; Fri, 19 Feb 2021 15:58:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6AEFC38708CE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=charter.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jvdelisle@charter.net Received: from [192.168.1.9] ([96.41.221.129]) by cmsmtp with ESMTPA id D8AXllsMcd7s7D8AYlDK0N; Fri, 19 Feb 2021 15:58:15 +0000 Authentication-Results: charter.net; none X-Authority-Analysis: v=2.3 cv=Db+jVclW c=1 sm=1 tr=0 a=07pILqX15KmGv9ZXTMmBNA==:117 a=07pILqX15KmGv9ZXTMmBNA==:17 a=IkcTkHD0fZMA:10 a=QrTTJ2a1GXB2jLQ3vcMA:9 a=QEXdDO2ut3YA:10 Subject: Re: [patch, fortran] PR96686 Namelist group objects shall be defined before appearing in namelist To: Tobias Burnus , gfortran References: <61fc2d13-04fc-0262-578a-b3f48d130589@charter.net> <4ae5418a-a51d-23a4-12fe-81342bd6f7d2@codesourcery.com> From: Jerry DeLisle Message-ID: <3811e3ad-8db4-f031-95e9-6ade0f63ef0d@charter.net> Date: Fri, 19 Feb 2021 07:58:13 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <4ae5418a-a51d-23a4-12fe-81342bd6f7d2@codesourcery.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CMAE-Envelope: MS4wfDGk92ub59cW2AAhRJ+rpkyql942i7MTl1VlS8pnLV6vXHlui+0/cN2UdLBJvSYcaWSofICHagsEj4m1wLpumbkc4gXwHeTyhhNf8+SYC1mTadd9p2JA PnF8CHv4yf8JL0izdSFm/wxMyKlddBzEw7UIiajGkodYO2luBS7kCjB9Iary/zpyi2i7uu5Pk/EWGC2PC4rUAiuOEjbwSXTkiwA= X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 15:58:16 -0000 On 2/17/21 1:19 AM, Tobias Burnus wrote: > Hi Jerry, > > I note that you have not written that testcase and I am still half > aspleep, but I fail to see what's wrong with the following program > (before and after your change): > > f2 looks like a local and implicitly typed real variable. At least ifort > compiles this program successfully. > > F2018 has: "A namelist group object shall either be accessed by use or > host association or shall have its declared type, kind type parameters > of the declared type, and rank specified by previous specification > statements or the procedure heading in the same scoping unit or by the > implicit typing rules in effect for the scoping unit. If a namelist > group object is typed by the implicit typing rules, its appearance in > any subsequent type declaration statement shall confirm the implied type > and type parameters." > > Tobias > ---  snip --- So the program in question, extracted from namelist_4.f90, showing the other possible use of f2. program p1 contains   integer function f1()     !f2 = 1   !This gives an error trying to assign a vakue to a function.     j = f2    ! This is OK     f1 = 1   end function   integer function f2()     f2=1   end function end As far as I understand, gfortran has this correct, unless there is something in the standard I don't know yet. Jerry