| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR 47023: C_Sizeof: Rejects valid code |
| 4 |
! |
| 5 |
! Contributed by Janus Weil <[email protected]> |
| 6 |
|
| 7 |
use iso_c_binding |
| 8 |
procedure(real) :: proc |
| 9 |
procedure(real), pointer :: pp |
| 10 |
pp => sin |
| 11 |
|
| 12 |
print *,sizeof(proc) ! { dg-error "shall not be a procedure" } |
| 13 |
print *,sizeof(pp) ! { dg-error "shall not be a procedure" } |
| 14 |
print *,sizeof(pp(0.)) |
| 15 |
print *,sizeof(sub) ! { dg-error "shall not be a procedure" } |
| 16 |
print *,sizeof(func) ! { dg-error "shall not be a procedure" } |
| 17 |
print *,sizeof(func()) |
| 18 |
|
| 19 |
contains |
| 20 |
|
| 21 |
subroutine sub |
| 22 |
end subroutine |
| 23 |
|
| 24 |
real function func() |
| 25 |
func = 0. |
| 26 |
end function |
| 27 |
|
| 28 |
end |