view gcc/testsuite/gfortran.dg/kind_1.f90 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! PR 63363: No diagnostic for passing function as actual argument to KIND
!
! Contributed by Ian Harvey <ian_harvey@bigpond.com>

  type :: t
  end type
  type(t) :: d
  class(*), allocatable :: c

  print *, KIND(d)    ! { dg-error "must be of intrinsic type" }
  print *, KIND(c)    ! { dg-error "must be of intrinsic type" }

  print *, KIND(f)    ! { dg-error "must be a data entity" }
  print *, KIND(f())
  print *, KIND(s)    ! { dg-error "must be a data entity" }
contains
  FUNCTION f()
    INTEGER(SELECTED_INT_KIND(4)) :: f
  END FUNCTION
  subroutine s
  end subroutine
END