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/57966] [OOP] Using a TBP to specify the shape of a dummy argument


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57966

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-24
                 CC|                            |janus at gcc dot gnu.org
            Summary|Using a TBP to specify the  |[OOP] Using a TBP to
                   |shape of a dummy argument   |specify the shape of a
                   |                            |dummy argument
     Ever confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to stefan.mauerberger from comment #0)
> Hi There!

Hi!


> I am faced with some weired behavior. Because it is a little hard to
> describe I am providing an example:

... which is anyway a much better idea than trying to describe it.


> Attached, there is a minimal example. Compiling it with gfortran terminates
> with:
> > test.f90:33.22:
> >
> >        REAL :: field( config%my_size() )
> >                      1
> > Error: 'my_size' at (1) should be a FUNCTION
> 
> Any ideas? 

Seems like you hit a bug. I can reproduce it with 4.7, 4.8 and trunk.

Slightly reduced test case:

MODULE my_mod
  IMPLICIT NONE

  TYPE config_cls
  CONTAINS
    PROCEDURE, NOPASS :: my_size
  END TYPE

  TYPE(config_cls) :: config

CONTAINS

  PURE INTEGER FUNCTION my_size()
    my_size = 10
  END FUNCTION

  SUBROUTINE my_sub( field )
    REAL :: field( config%my_size() )
  END SUBROUTINE

END MODULE


Thanks for reporting ...

Cheers,
Janus


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