[J3] Is this standard-conforming?
Vipul Parekh
parekhvs at gmail.com
Thu Jul 26 10:51:40 EDT 2018
I think the code is non-conforming. This is on account of an
inaccessible entity in terms of host association,
With 10-007r1 document toward Fortran 2008, section 12.4.3.3 IMPORT
statement has in paragraph 1,
"The name of an entity made accessible by an IMPORT statement shall
not appear in any of the contexts described in 16.5.1.4 that cause the
host entity of that name to be inaccessible."
Then in paragraph 1 in section 16.5.1.4 Host association,
"An interface body that is not a separate interface body has access
via host association to the named entities from its host that are made
accessible by IMPORT statements in the interface body."
And in paragraph 2,
"A name that appears in the scoping unit as .. a named-constant in a
named-constant-def in a parameter-stmt .. is a local identifier in the
scoping unit and any entity of the host that has this as its
nongeneric name is inaccessible by that name by host association."
I might be wrong but my interpretation of above is the named constant
c_name is inaccessible in the interface body.
I'll be keen to read further comments on this.
Regards,
Vipul
On Thu, Jul 26, 2018 at 9:25 AM Steve Lionel via J3
<j3 at mailman.j3-fortran.org> wrote:
>
> On 7/26/2018 6:12 AM, Damian Rouson via J3 wrote:
> > One processor accepts the code below. Three others generate error
> > messages related to the binding label c_name and either report a
> > syntax error or report that the binding label is a variable that does
> > not reduce to a constant expression.
>
> It is clear to me that this is standard-conforming. The binding label is
> required to be a default-char-constant-expression, and c_name, visible
> in the interface block through the import, is exactly that. If there is
> some additional restriction on the NAME= value that prohibits this, I
> can't find it.
>
> As a former developer, though, I can understand how this sort of thing
> happens.
>
> Steve
>
More information about the J3
mailing list