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

            Bug ID: 88467
           Summary: Silently accepts wrong array constructor
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Extracted from pr88116.  Silently accepts these array
constructors and consequently prints wrong results :


$ cat z1.f90
program p
   print *, [integer :: 1, [integer(1) :: '3', 4]]
   print *, [integer :: 1, [integer(2) :: '3', 4]]
   print *, [integer :: 1, [integer(8) :: '3', 4]]
   print *, [integer :: 1, [integer(16) :: '3', 4]]
end


$ cat z2.f90
program p
   print *, [integer :: 1, [integer(1) :: 2, '3']]
   print *, [integer :: 1, [integer(2) :: 2, '3']]
   print *, [integer :: 1, [integer(8) :: 2, '3']]
   print *, [integer :: 1, [integer(16) :: 2, '3']]
end


$ cat z3.f90
program p
   print *, [integer(8) :: 1, [integer(4) :: 2, '3']]
end


$ gfortran-9-20181209 z1.f90 -static-libgfortran
$ a.out
           1           0           4
           1           0           4
           1           0           4
           1           0           4

$ gfortran-9-20181209 z3.f90 -static-libgfortran
$ a.out
                    1                    2                    0
$

Reply via email to