This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR 36426


Hi Janus,

Janus Weil wrote:
About comment #0 in the PR: I'm assuming that a statement like

character(len=len(x)) :: x

is invalid, since the symbol x is used in it's own declaration. Can
someone confirm that? This line gives the somewhat strange error
message:

   character(len=len(x)) :: x
                            1
Error: Symbol 'x' at (1) already has basic type of REAL

Using "implicit none" the error transforms into

   character(len=len(x)) :: x
                    1
Error: Symbol 'x' is used before it is typed at (1)

which is much clearer.

this is a fix I did some months ago. The basic type REAL stems from the fact that x is implicitelly typed (and thus REAL) once it is used in the LEN call.


I hope the error is at least somewhat clear and ok this way, but I don't know how to make it better for implicit typing.

Cheers,
Daniel

--
Done:  Arc-Bar-Cav-Rog-Sam-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran-Tou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]