This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/60526] [4.9/5/6 Regression] Accepts-invalid: Variable name same as type name


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60526

--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Created attachment 37495
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37495&action=edit
provisional patch

The patch appears to work, but the formatting for the errors looks strange.

Consider:

ig25@linux-fd1f:~/Krempel/Type> cat type.f90 
type X
end type

integer :: q
real :: a
integer, parameter :: h=3

type(X) :: X

end
ig25@linux-fd1f:~/Krempel/Type> gfortran type.f90 
type.f90:8:12:

 type X
      2      
 end type



 integer :: q

 real :: a

 integer, parameter :: h=3



 type(X) :: X
            1
Error: Symbol Âx at (1) also declared as a type at (2)

I do not know why the intermediate lines between the type definition
and the delcaration of X are also printed.

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