view gcc/testsuite/gfortran.dg/sizeof_proc.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
!
! PR 47023: C_Sizeof: Rejects valid code
!
! Contributed by Janus Weil <janus@gcc.gnu.org>

use iso_c_binding
procedure(real) :: proc
procedure(real), pointer :: pp
pp => sin

print *,sizeof(proc)    ! { dg-error "shall not be a procedure" }
print *,sizeof(pp)      ! { dg-error "shall not be a procedure" }
print *,sizeof(pp(0.))
print *,sizeof(sub)     ! { dg-error "shall not be a procedure" }
print *,sizeof(func)    ! { dg-error "shall not be a procedure" }
print *,sizeof(func())

contains

  subroutine sub
  end subroutine

  real function func()
    func = 0.
  end function

end