blob: b4a2d7320038fcf464207aa6274722a8296ffd47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
! { 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 "may not be a procedure" }
print *,sizeof(pp) ! { dg-error "may not be a procedure" }
print *,sizeof(pp(0.))
print *,sizeof(sub) ! { dg-error "may not be a procedure" }
print *,sizeof(func) ! { dg-error "may not be a procedure" }
print *,sizeof(func())
contains
subroutine sub
end subroutine
real function func()
func = 0.
end function
end
|