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

--- Comment #12 from anlauf at gcc dot gnu.org ---
A further suggestion: the new testcase verifies some result numerically.
If you also want to verify that we get the right type, one could do:

program p
  class(*), allocatable :: res(:)
  res = [integer :: ([1.0])] **  2
  call verify_integer (res, 1)
  deallocate (res)
contains
  subroutine verify_integer (x, stopcode)
    class(*), intent(in) :: x(:)
    integer,  intent(in) :: stopcode
    select type (x)
    type is (integer)
       print *, "integer!"
    class default
       print *, "wrong type, not integer!"
       stop stopcode
    end select
  end subroutine verify_integer
end program p

Without your patch, this gives:

 wrong type, not integer!
STOP 1

Reply via email to