------- Comment #7 from janus at gcc dot gnu dot org 2010-01-19 17:24 ------- We probably have the same trouble with procedure pointer components, which can also have passed-object arguments.
However, when trying to construct an analogous PPC test case, I came across another bug. Here is the test case with a PPC instead of a TBP: MODULE ModA IMPLICIT NONE TYPE, PUBLIC :: A PROCEDURE(a_proc),pointer :: Proc END TYPE A CONTAINS SUBROUTINE a_proc(this, stat) CLASS(A), INTENT(INOUT) :: this INTEGER, INTENT(OUT) :: stat WRITE (*, *) 'a_proc' stat = 0 END SUBROUTINE a_proc END MODULE ModA PROGRAM ProgA USE ModA IMPLICIT NONE INTEGER :: ierr INTEGER :: i TYPE(A), ALLOCATABLE :: arr(:) ALLOCATE(arr(2)) DO i = 1, 2 arr(i)%proc => a_proc CALL arr(i)%Proc(ierr) END DO END PROGRAM ProgA Compiling this gives: CALL arr(i)%Proc(ierr) 1 Error: Passed-object at (1) must be scalar Now, the passed-object is obviously scalar (it's an element of an array), so this surely is a bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42804