| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=legacy" } |
| 3 |
! |
| 4 |
! Test the fix for PR49630, comment #11. |
| 5 |
! |
| 6 |
! Contributed by Vittorio Zecca <[email protected]> |
| 7 |
! |
| 8 |
module abc |
| 9 |
implicit none |
| 10 |
type,abstract::abc_abstract |
| 11 |
contains |
| 12 |
procedure(abc_interface),deferred::abc_function |
| 13 |
end type abc_abstract |
| 14 |
type,extends(abc_abstract)::abc_type |
| 15 |
contains |
| 16 |
procedure::abc_function |
| 17 |
end type abc_type |
| 18 |
abstract interface |
| 19 |
function abc_interface(this) ! { dg-error "assumed character length result" } |
| 20 |
import abc_abstract |
| 21 |
class(abc_abstract),intent(in)::this |
| 22 |
character(len=*)::abc_interface |
| 23 |
end function abc_interface |
| 24 |
end interface |
| 25 |
contains |
| 26 |
function abc_function(this) |
| 27 |
class(abc_type),intent(in)::this |
| 28 |
character(len=5)::abc_function |
| 29 |
abc_function="hello" |
| 30 |
end function abc_function |
| 31 |
subroutine do_something(this) |
| 32 |
class(abc_abstract),intent(in)::this |
| 33 |
print *,this%abc_function() |
| 34 |
end subroutine do_something |
| 35 |
end module abc |