This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/77385] "Unclassifiable statement" from gfortran


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-09-28
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.7 up to trunk (7.0), Polymorphic arrays are not yet supported
on 4.6.

Note that the following variant

MODULE a
   IMPLICIT NONE
   TYPE :: b
      CONTAINS
         PROCEDURE :: e
   END TYPE b
   TYPE :: c
      CLASS(b), POINTER :: i(:) => NULL()
   END TYPE c
   CONTAINS
      FUNCTION e(this ) RESULT (s)
         CLASS(b) :: this
         TYPE(b) :: s
         s = b()
      END FUNCTION e
END MODULE a
MODULE m
   USE a
   IMPLICIT NONE
   TYPE d
      CLASS(b), DIMENSION(:), POINTER :: f => NULL()
   END TYPE d
   CONTAINS
      FUNCTION g() RESULT (h)
         TYPE(d) :: j
         TYPE(c) :: h
         allocate(j%f(1))
         print *, shape(j%f)
         ASSOCIATE( k => j%f )
         END ASSOCIATE
      END FUNCTION g
END MODULE m
   use m
   type(c) :: res
   res = g()
end

gives

          ASSOCIATE( k => j%f )

internal compiler error: Segmentation fault: 11

and

MODULE a
   IMPLICIT NONE
   TYPE :: b
      CONTAINS
         PROCEDURE :: e
   END TYPE b
   TYPE :: c
      CLASS(b), POINTER :: i(:) => NULL()
   END TYPE c
   CONTAINS
      FUNCTION e(this ) RESULT (s)
         CLASS(b) :: this
         TYPE(b) :: s
         s = b()
      END FUNCTION e
END MODULE a
MODULE m
   USE a
   IMPLICIT NONE
   TYPE d
      CLASS(b), DIMENSION(:), POINTER :: f => NULL()
   END TYPE d
   CONTAINS
      FUNCTION g() RESULT (h)
         TYPE(d) :: j
         TYPE(c) :: h
            ALLOCATE(h%i(1))
            allocate(j%f(1))
            SELECT TYPE ( l => h%i )
            TYPE IS ( b )
               l(1) = j*f(1)%e()
            END SELECT
      END FUNCTION g
END MODULE m

gives

                l(1) = j*f(1)%e()
                             1
Error: Symbol 'f' at (1) has no IMPLICIT type

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]