public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC: Confirmation of IMPLICIT types variables by subsequent Explicit declaration.
@ 2021-02-14 20:44 Jerry DeLisle
  0 siblings, 0 replies; only message in thread
From: Jerry DeLisle @ 2021-02-14 20:44 UTC (permalink / raw)
  To: gfortran

Hi all,

Prompted by PR98686, I have found four places in the 2018 standard where 
variables typed implicitly must be confirmed by any subsequent explicit 
declarations.  The four places are in DATA statements, NAMELIST 
statements, Specification Expressions, and Statement Functions (see 
excerpts below).

My take on this is that if one uses IMPLICIT NONE, one does not need to 
be concerned with this.  However if there is no IMPLICIT NONE or someone 
uses specific IMPLICIT statements, these conditions need to be checked 
and it is an error if it subsequent explicit type declarations do not 
agree with the implicit ones?

Is my thinking correct?  Is this situation on the programmer to avoid or 
should the compiler provide diagnostics such as a warning or error?

Regards,

Jerry

Excerpts here:

8.6.7 DATA statement

A variable that appears in a DATA statement and has not been typed 
previously may appear in a subsequent type declaration only if that 
declaration confirms the implicit typing.

8.9 NAMELIST statement

If a namelist group object is typed by the implicit typing rules, its 
appearance in any subsequent type declaration statement shall confirm 
the implied type and type parameters.

10.11.1 Specification Expressions

If a variable in a specification expression is typed by the implicit 
typing rules, its appearance in any subsequent type declaration 
statement shall confirm the implied type and type parameters.

15.6.4 Statement function

If a dummy-arg-name, variable, function reference, or dummy function 
reference is typed by the implicit typing rules, its appearance in any 
subsequent type declaration statement shall confirm this implied type 
and the values of any implied type parameters.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-14 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 20:44 RFC: Confirmation of IMPLICIT types variables by subsequent Explicit declaration Jerry DeLisle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).