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/67802] ICE on initializing character with wrong len type


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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Whereas, without initialization relevant errors are detected :


$ cat za1.f90
program p
   character(1.) :: c1
   character(1d1) :: c2
   character((0.,1.)) :: c3
   character(.true.) :: c4
end


$ cat zp1.f90
program p
   real, parameter :: n1 = 1.
   double precision, parameter :: n2 = 1d1
   complex, parameter :: n3 = (0.,1.)
   logical, parameter :: n4 = .true.
   character(n1) :: c1
   character(n2) :: c2
   character(n3) :: c3
   character(n4) :: c4
end


$ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize zp1.f90
zp1.f90:9:13:

    character(n4) :: c4
             1
Error: Expression at (1) must be of INTEGER type, found LOGICAL
zp1.f90:8:13:

    character(n3) :: c3
             1
Error: Expression at (1) must be of INTEGER type, found COMPLEX
zp1.f90:7:13:

    character(n2) :: c2
             1
Error: Expression at (1) must be of INTEGER type, found REAL
zp1.f90:6:13:

    character(n1) :: c1
             1
Error: Expression at (1) must be of INTEGER type, found REAL


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