| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fcoarray=lib" } |
| 3 |
! Check that error message is presented as long as polymorphic coarrays are |
| 4 |
! not implemented. |
| 5 |
|
| 6 |
module maccscal |
| 7 |
type t |
| 8 |
real, allocatable :: a |
| 9 |
end type |
| 10 |
contains |
| 11 |
subroutine s(x) ! { dg-error "Sorry, allocatable/pointer components in polymorphic \\(CLASS\\)" } |
| 12 |
class(t) :: x[*] |
| 13 |
allocate (x%a) |
| 14 |
end |
| 15 |
end |
| 16 |
module mptrscal |
| 17 |
type t |
| 18 |
real, pointer :: a |
| 19 |
end type |
| 20 |
contains |
| 21 |
subroutine s(x) ! { dg-error "Sorry, allocatable/pointer components in polymorphic \\(CLASS\\)" } |
| 22 |
class(t) :: x[*] |
| 23 |
allocate (x%a) |
| 24 |
end |
| 25 |
end |
| 26 |
module mallarr |
| 27 |
type t |
| 28 |
real, allocatable :: a(:) |
| 29 |
end type |
| 30 |
contains |
| 31 |
subroutine s(x) ! { dg-error "Sorry, allocatable/pointer components in polymorphic \\(CLASS\\)" } |
| 32 |
class(t) :: x[*] |
| 33 |
allocate (x%a(2)) |
| 34 |
end |
| 35 |
end |
| 36 |
module mptrarr |
| 37 |
type t |
| 38 |
real, pointer :: a(:) |
| 39 |
end type |
| 40 |
contains |
| 41 |
subroutine s(x) ! { dg-error "Sorry, allocatable/pointer components in polymorphic \\(CLASS\\)" } |
| 42 |
class(t) :: x[*] |
| 43 |
allocate (x%a(2)) |
| 44 |
end |
| 45 |
end |