From JLS@liverpool.ac.uk Mon Nov  2 17:03:36 1992
Received: from vm.uni-c.dk by dkuug.dk with SMTP id AA23344
  (5.65c8/IDA-1.4.4j for <SC22WG5@DKUUG.DK>); Mon, 2 Nov 1992 18:12:33 +0100
Message-Id: <199211021712.AA23344@dkuug.dk>
Received: from vm.uni-c.dk by vm.uni-c.dk (IBM VM SMTP V2R2) with BSMTP id 7992;
   Mon, 02 Nov 92 18:13:59 DNT
Received: from UKACRL.BITNET by vm.uni-c.dk (Mailer R2.07) with BSMTP id 9031;
 Mon, 02 Nov 92 18:13:58 DNT
Received: from RL.IB by UKACRL.BITNET (Mailer R2.07) with BSMTP id 3534; Mon,
 02 Nov 92 17:14:16 GMT
Received: from RL.IB by UK.AC.RL.IB (Mailer R2.07) with BSMTP id 8107; Mon, 02
 Nov 92 17:13:53 GMT
Via:         UK.AC.LIV.IBM;  2 NOV 92 17:12:46 GMT
Received:     from UK.AC.LIVERPOOL
              by MAILER(4.4.t);  2 Nov 1992 17:09:41 GMT
Date:        Mon, 02 Nov 92 17:03:36 GMT
From: Lawrie Schonfelder <JLS@liverpool.ac.uk>
Subject:      Re: RFI: Automatic character and ALLOCATABLE, POINTER and TARGET
To: jls@juniper.cray.com, SC22/WG5 members <SC22WG5@dkuug.dk>
In-Reply-To: Your message of Wed, 28 Oct 92 20:38:42 CST
X-Charset: ASCII
X-Char-Esc: 29

On Wed, 28 Oct 92 20:38:42 CST jls@com.cray.juniper said:

>The following is an amended version of a previous posting of 92-206.  The
>changes are the title, keywords, and addition of questions 3 and 4 which
>are related to the original request and have surfaced in Janice Sheperd and
>Alan Meyer's recent postings.  The amended request will be on the table as
>92-206a at the New Haven meeting.
>
>-------
>To     : X3J3                                                    X3J3/92-206a
>From   : Jon Steidel                                             Meeting 123
>Subject: Request for interpretation
>
>
>NUMBER:
>TITLE: Automatic character and ALLOCATABLE, POINTER and TARGET attributes
>KEYWORDS: Allocatable, automatic, array, character, pointer, target
>DEFECT TYPE: Interpretation
>STATUS:
>
>QUESTION: Section 5.1 states:
>
>   The specification-expr (7.1.6.2) of a type-param-value (5.1.1.5)
>   or an array-spec (5.1.2.4) may be a nonconstant expression provided the
>   specification expression is in an interface body (12.3.2.1) or in the
>   specification part of a subprogram.  If the data object being declared
>   depends on the value of such a nonconstant expression and is not a
>   dummy argument, such an object is called an automatic data object.  An
>   automatic object must not appear in a SAVE or DATA statement nor be declared
>   with a SAVE attribute nor be initially defined by an = initialization-expr.
>
>Thus, a character object with a length-selector which is a nonconstant
>type-param-value is an automatic object.
>
>Section 5.1.2.9 states:
>
>   The ALLOCATABLE attribute specifies that objects declared in the statement
>   are allocatable arrays.  Such arrays must be deferred-shape arrays whose
>   shape is determined when space is allocated for each array by the execution
>   of an ALLOCATE statement (6.3.1).
>
>I am unable to find words which prohibit allocatable arrays of automatic
>objects.
>
>Question 1: Is it the intent to allow allocatable arrays of automatic
character?
My reaction is YES.
>
>      FUNCTION FRED (J)
>      CHARACTER(LEN=J),DIMENSION(:),ALLOCATABLE :: CH
>      ALLOCATE (CH(100))
>
>Question 2: If allocatable arrays of automatic objects are allowed, is it
>correct to assume the array must not have the SAVE attribute?
No SAVE must not be specified for all the obvious reasons.
>
>Question 3: Since objects with the POINTER attribute may be allocated, is
>it intended that automatic objects (specifically type character with length
>specified by a variable expression) may have the POINTER attribute?
YES there is no reason to prohibit them they are simply automatic
>
>Question 4: The third constraint of Section 7.5.2 states
>
>  The target must be of the same type, type parameters, and rank as the
pointer.
>
>In general, I don't see a problem with allowing the POINTER and TARGET
>attribute for automatic arrays.  However, there is a problem if TARGET is
>intended to be allowed for automatic character, both scalar and arrays,
>where the length is specified by a variable expression.  Character length
>is part of the type and type parameters, but where length is specified by
>a variable, the above constraint cannot be diagnosed at compile time.
>Was it the intent to allow the TARGET attribute on any automatic objects,
>only on automatic arrays except where character length is specified by
>a variable expression, or for no automatic objects?  If the intent is to
>allow TARGET on all automatic objects, the above constraint must be relaxed
>as it cannot be detected at compile time.
If this requires a constraint to be recast as a semantic restriction so be it.
pointer assignment should obey this rule.
>
>
>ANSWER:
>
>Discussion:
>
>REFERENCES:
>
>EDIT:
>
>SUBMITTED BY: Jon Steidel
>HISTORY: Initially drafted as X3J3/92-206
>
