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

--- Comment #1 from janus at gcc dot gnu.org ---
Another case for which I don't see why one should throw a warning (but I get
two):


program p

   implicit none
   character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)

   if (.not. check(formats)) then
      print *, "error"
   end if

contains

   logical function check(setStr)
      character(len=*), dimension(:), contiguous, intent(in) :: setStr
      check = .false.
   end function

end



c1.f90:4:48:

    character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)
                                                1
Warning: Creating array temporary at (1) [-Warray-temporaries]
c1.f90:4:48:

    character(len=2), parameter :: formats(1:5) = (/ 'A ', 'B ', 'C ', 'D ', 'E
' /)
                                                1
Warning: Creating array temporary at (1) for argument ‘setstr’
[-Warray-temporaries]



It seems like one is for the assignment, and another is for the function call
(with wrong locus). Without 'contiguous' only one remains.

Reply via email to