From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id C68863858417 for ; Tue, 22 Nov 2022 21:59:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C68863858417 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 2AMLxVod057974 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 22 Nov 2022 13:59:31 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 2AMLxVv9057973 for fortran@gcc.gnu.org; Tue, 22 Nov 2022 13:59:31 -0800 (PST) (envelope-from sgk) Date: Tue, 22 Nov 2022 13:59:31 -0800 From: Steve Kargl To: Harald Anlauf via Fortran Subject: Re: typespec in forall and implied-do Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Nov 22, 2022 at 10:15:39PM +0100, Harald Anlauf via Fortran wrote: > Minor addition: > > program foo > implicit none > real(8) :: i > integer, parameter :: q(*) = [(kind(i), integer :: i = 1, 3)] > print *, q > end program foo > > This prints > > 8 8 8 > > although it should be all 4's. So we really need to create a local > namespace or even block to shadow the host's variable. > > Crayftn and NAG accept this too, Intel has a problem report on this. > I'll see if I can make the shadow variable idea work. For two lines integer, parameter :: q(3) = [(kind(i), integer :: i = 1, 3)] integer :: p(3) = [(kind(i), integer :: i = 1, 3)] I believe the paths through the compiler differ sufficiently, and the shado variable might help in keeping the change simple. -- Steve