[Bug fortran/57966] New: Using a TBP to specify the shape of a dummy argument
stefan.mauerberger at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 24 10:40:00 GMT 2013
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.
More information about the Gcc-bugs
mailing list