| 1 |
module m |
| 2 |
use iso_c_binding |
| 3 |
implicit none (type, external) |
| 4 |
contains |
| 5 |
|
| 6 |
! All of the following use an array descriptor |
| 7 |
! F2018, 18.3.7 (5) applies: |
| 8 |
|
| 9 |
subroutine f1 (x) bind(c) ! { dg-error "Dummy argument 'x' at .1. may not be a pointer with CONTIGUOUS attribute as procedure 'f1' is BIND\\(C\\)" } |
| 10 |
character(len=:, kind=c_char), pointer, contiguous :: x(:) |
| 11 |
end |
| 12 |
|
| 13 |
subroutine f2 (x) bind(c) ! { dg-error "Dummy argument 'x' at .1. may not be a pointer with CONTIGUOUS attribute as procedure 'f2' is BIND\\(C\\)" } |
| 14 |
integer(c_int), pointer, contiguous :: x(:) |
| 15 |
end |
| 16 |
|
| 17 |
subroutine f3 (x) bind(c) |
| 18 |
character(len=:, kind=c_char), pointer :: x(:) ! OK - pointer but not contiguous |
| 19 |
end |
| 20 |
|
| 21 |
subroutine f4 (x) bind(c) |
| 22 |
character(len=*, kind=c_char), contiguous :: x(:) ! OK - contiguous but not a pointer |
| 23 |
end |
| 24 |
|
| 25 |
subroutine f5 (x) bind(c) |
| 26 |
integer(c_int), pointer :: x(:) ! OK - pointer but not contigous |
| 27 |
end |
| 28 |
|
| 29 |
subroutine f6 (x) bind(c) |
| 30 |
integer(c_int), contiguous :: x(:) ! OK - contiguous but not a pointer |
| 31 |
end |
| 32 |
|
| 33 |
end |