J3/15-161r1 To: J3 From: Van Snyder & Malcolm Cohen Subject: Interp: assign to deferred-length coindexed character Date: 2015 August 04 ---------------------------------------------------------------------- NUMBER: F08/0140 TITLE: Assign to deferred-length coindexed character variable KEYWORDS: Cobounds, type declaration DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Q1. Consider the program: Program p1 Character(:), Allocatable :: C[*] Allocate ( Character(42) :: C ) c = 'stuff' End Program Is the assignment permitted? Q2. Consider Program p2 Character(:), Pointer :: C[*] Allocate ( Character(42) :: C ) c = 'stuff' End Program ANSWER: A1. This is not permitted, as it violates the requirement in 7.2.1.2 Intrinsic assignment statement, paragraph 2, which states that if the variable (in an intrinsic assignment statement) is coindexed, its deferred length type parameters shall be the same as the corresponding type parameters of the expression. There is a grammatical error in this requirement; an edit is supplied to correct the grammatical error. A2. This was intended to be permitted, but was inadvertantly caught in the prohibition that was intended to apply only to allocatable variables. An edit is supplied to correct this error. EDITS: [153:25] 7.2.1.2p2, after "coindexed object,", delete "the variable", [153:26] before "shall not be" insert "the variable", [153:27] before "shall not have" insert "the variable", [153:28] change "each" to "if the variable is allocatable, each". making the whole paragraph read "If is a coindexed object, - the variable shall not be polymorphic, - the variable shall not have an allocatable ultimate component, and - if the variable is allocatable, each deferred length type parameter shall have the same value as the corresponding type parameter of .". SUBMITTED BY: Van Snyder HISTORY: 15-161 m207 F08/0140 submitted 15-161r1 m207 Revised question and answers. ----------------------------------------------------------------------