J3/13-299r1 To: J3 From: Van Snyder & Malcolm Cohen Subject: For editorial consideration concerning DATA statements Date: 2013 October 14 1. The problem -------------- Subclause 5.4.7, paragraph 2, says "If a nonpointer object has default initialization, it shall not appear in a ." Consider the following definitions and declarations: type :: T integer :: I = 3 real :: X = 42.0 end type type(t), parameter :: P = t() integer :: A(p%i), I 1 data ( a(i), i = 1, p%i ) / 1, 2, 3 / Statement 1 is prohibited by 5.4.7p2, but this is clearly nonsensical, because it is not initializing p%i (which is constant). 2. Edits -------- [5.4.7p2 104:7] Replace "object" with "variable". 3. Suggestion for F2015 Wart Removal ------------------------------------ NOTE: This is for consideration only if 13-353 is not accepted. Requirement: Require diagnosis of an attempt to explicitly initialize a default-initialized variable in a DATA statement. Rationale: Processors are not required to report violation of this because it is not a constraint. This can cause delayed portability problems if some processors ignore it as a convenient extension. Specification: Make the requirement, that a variable whose type has default initialization is not permitted to appear in a , into a constraint. Syntax: No new syntax. Edits to 10-007r1: [104:7] 5.4.7p2, delete. [104:31+] After C567 insert new constraint "C567a (R536) A that is a shall neither have default initialization nor be a subobject of a variable that has default initialization." ===END===