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

            Bug ID: 83548
           Summary: Compilation Error using logical function in parameter
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: j-pierre.lefebvre at edf dot fr
  Target Milestone: ---

The following reproducer:

program testit

    integer, parameter :: nb_field_defi = 19
    logical(kind=1), parameter :: l_read_init(nb_field_defi) = &
                                                (/logical(.true.,
1),logical(.true., 1) ,logical(.true., 1) ,&
                                                 logical(.false.,
1),logical(.true., 1) ,logical(.true., 1) ,&
                                                 logical(.true., 1)
,logical(.true., 1) ,logical(.true., 1) ,&
                                                 logical(.false., 1),&
                                                 logical(.true., 1)
,logical(.true., 1) ,logical(.true., 1) ,&
                                                 logical(.false.,
1),logical(.true., 1) ,&
                                                 logical(.true., 1)
,logical(.true., 1) ,logical(.false., 1),&
                                                 logical(.false., 1)/)
    do k=1,nb_field_defi
       write(6,*) ' l_read_init = ',k,l_read_init(k)
    end do

end program testit

fails to compile with gfortran 6.3.0-1, and gfortran 5.4.0-6 (OK with gfortran
4.9.2-10)

>gfortran  testit.f90

testit.f90:3:64:

                                                 (/logical(.true.,
1),logical(.true., 1) ,logical(.true., 1) ,&
                                                                1
Error: Integer expression required at (1)

additional information 
----------------------

change first affectation in parameter with .true._1 and it works !

Reply via email to