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 753643889E16 for ; Wed, 16 Nov 2022 02:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 753643889E16 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 2AG2VGon058771 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 15 Nov 2022 18:31:16 -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 2AG2VGHg058770 for fortran@gcc.gnu.org; Tue, 15 Nov 2022 18:31:16 -0800 (PST) (envelope-from sgk) Date: Tue, 15 Nov 2022 18:31:16 -0800 From: Steve Kargl To: Steve Kargl 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 15, 2022 at 05:13:19PM -0800, Steve Kargl via Fortran wrote: > F2008 introduced the inclusion of a typespec in a forall > statement, and thn F2018 a typespec was allowed in an > implied-do. There may even be a few bug reports. > Forgot to ask. Anyone know how namespaces work with initialization expressions in gfortran? This code should compile program foo use iso_fortran_env, only : k => real_kinds implicit none integer, parameter :: n = size(k) integer, parameter :: & & p(n) = [(precision(real(1.,k(i))), integer :: i = 1, n)] print '(*(I0,X))', p end program foo The first occurence of 'i' in the expression for 'p(n)' is either thought to be in a different namespace, or an implied-do loop cannot be used in an initialization expression. -- Steve