| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/56650 |
| 4 |
! PR fortran/36437 |
| 5 |
! |
| 6 |
subroutine foo(x, y) |
| 7 |
use iso_c_binding |
| 8 |
type(*) :: x |
| 9 |
integer :: y(*) |
| 10 |
integer(8) :: ii |
| 11 |
procedure() :: proc |
| 12 |
|
| 13 |
ii = sizeof (x) ! { dg-error "'x' argument of 'sizeof' intrinsic at \\(1\\) shall not be TYPE\\(\\*\\)" } |
| 14 |
ii = c_sizeof (x) ! { dg-error "Assumed-type argument at .1. is not permitted as actual argument to the intrinsic c_sizeof" } |
| 15 |
ii = storage_size (x) ! { dg-error "Assumed-type argument at .1. is not permitted as actual argument to the intrinsic storage_size" } |
| 16 |
|
| 17 |
ii = sizeof (y) ! { dg-error "shall not be an assumed-size array" } |
| 18 |
ii = c_sizeof (y) ! { dg-error "\[Aa\]ssumed-size array" } |
| 19 |
ii = storage_size (y) ! okay, element-size is known |
| 20 |
|
| 21 |
ii = sizeof (proc) ! { dg-error "shall not be a procedure" } |
| 22 |
ii = c_sizeof (proc) ! { dg-error "Procedure unexpected as argument" } |
| 23 |
ii = storage_size (proc) ! { dg-error "shall not be a procedure" } |
| 24 |
end |