J3/13-299 To: J3 From: Van Snyder Subject: For editorial consideration concerning DATA statements Date: 2013 August 09 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 I have not met a processor that objects to it. Subclause 5.2.3 Initialization, which is referenced from 5.4.7p1, says explicit initialization applies to variables, not constants. The object p%i is a constant, not a variable. Its appearance as a in a does not cause any initialization, and therefore its appearance in a ought not to be prohibited. 2. Edits -------- [5.2.3p1 89:4] To avoid describing the exception twice, replace "statement unless ... specified" with "statement, except in cases prohibited in subclause 5.4.7." [5.4.7p2 104:7] Replace "object" with "variable". If this is still confusing, replace "appear in a " with "be initialized in a DATA statement". 3. Alternative edits -------------------- [5.2.3p1 89:4] To avoid describing the exception twice, replace "statement unless ... specified" with "statement, except in cases prohibited in subclause 5.4.7." Processors are not required to report violation of 5.4.7p2 because it is not a constraint. This can cause delayed portability problems if some processors ignore it as a convenient extension. Therefore [5.4.7p2 104:7] Delete the paragraph. [5.4.7 C567 104:28] After "shall not" insert "be of a type that has default initialization, and shall not".