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

urbanjost at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
            Summary|intent                      |uncaught programmer error:
                   |                            |polymorphic variable is
                   |                            |INTENT(IN) but assigned to
                   |                            |without error

--- Comment #1 from urbanjost at comcast dot net ---
program demo_setval
   call setval(value)
   write(*,*)'VALUE=',value
CONTAINS
   subroutine setval(value)
      class(*),intent(in)          :: value
      select type(value)
       type is (integer);          value=10
       type is (real);             value=10.20
      end select
   end subroutine setval
end program demo_setval
! expect to get something like
!    Error: Dummy argument 'value' with INTENT(IN) in variable definition
context (assignment) at (1)
! but do not even though VALUE is INTENT(IN) and changed the value


There is a programmer error in the example program. The variable VALUE has been
declared to be INTENT(IN) but the routine assigns a value to the variable. This
should be caught at compile time.

Reply via email to