blob: 0a63537888df8181e45b5bc6806e6788ab11d4e3 (
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 "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
|