| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR 43388: [F2008][OOP] ALLOCATE with MOLD= |
| 4 |
! |
| 5 |
! Contributed by Janus Weil <[email protected]> |
| 6 |
|
| 7 |
type :: t |
| 8 |
end type |
| 9 |
|
| 10 |
type :: u |
| 11 |
end type |
| 12 |
|
| 13 |
class(t),allocatable :: x |
| 14 |
type(t) :: z1,z2 |
| 15 |
type(u) :: z3 |
| 16 |
|
| 17 |
allocate(x,MOLD=z1,MOLD=z2) ! { dg-error "Redundant MOLD tag" } |
| 18 |
allocate(x,SOURCE=z1,MOLD=z2) ! { dg-error "conflicts with SOURCE tag" } |
| 19 |
allocate(t::x,MOLD=z1) ! { dg-error "conflicts with the typespec" } |
| 20 |
|
| 21 |
allocate(x,MOLD=z3) ! { dg-error "is type incompatible" } |
| 22 |
|
| 23 |
end |