public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57966] New: Using a TBP to specify the shape of a dummy argument
@ 2013-07-24 10:40 stefan.mauerberger at gmail dot com
  2013-07-24 11:34 ` [Bug fortran/57966] [OOP] " janus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: stefan.mauerberger at gmail dot com @ 2013-07-24 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57966
           Summary: Using a TBP to specify the shape of a dummy argument
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefan.mauerberger at gmail dot com

Created attachment 30542
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30542&action=edit
minimal example

Hi There!

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

There is a DDT 'config_cls' whose pure TBP 'my_size' does nothing but returning
10 .
> TYPE config_cls
> CONTAINS
>     PROCEDURE, NOPASS :: my_size
> END TYPE

> PURE INTEGER FUNCTION my_size()
>     my_size = 10
> END FUNCTION my_size

In addition there is a subroutine 'my_sub' which expects a dummy argument of
explicit shape 'config%my_size()'. 
> SUBROUTINE my_sub( field )
>     REAL, INTENT(INOUT) :: field( config%my_size() )
>     !REAL, INTENT(INOUT), CONTIGUOUS :: field(:) ! Assumed shape works
>     !REAL, INTENT(INOUT) :: field( my_size() ) ! works, too

> END SUBROUTINE my_sub
As far as I can see this is valid Fortran code. However, gfortran complains
that config%my_size() is not a function. Well, this is wrong (for non dummy
arguments it works perfectly fine)!

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? 

Cheers, Stefan 

Actually, ifort 12.1.6, nag 5.3.2 and pgfortran 13.4 are just fine.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-25 13:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 10:40 [Bug fortran/57966] New: Using a TBP to specify the shape of a dummy argument stefan.mauerberger at gmail dot com
2013-07-24 11:34 ` [Bug fortran/57966] [OOP] " janus at gcc dot gnu.org
2013-07-24 12:17 ` janus at gcc dot gnu.org
2013-07-24 14:39 ` janus at gcc dot gnu.org
2013-07-24 23:03 ` burnus at gcc dot gnu.org
2013-07-25  9:10 ` janus at gcc dot gnu.org
2013-07-25  9:23 ` burnus at gcc dot gnu.org
2013-07-25 12:29 ` janus at gcc dot gnu.org
2013-07-25 13:57 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).