Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

type declarations inside module procedures

2 views
Skip to first unread message

alexei....@gmail.com

unread,
Apr 17, 2009, 9:54:10 AM4/17/09
to

Dear All,

Is this a bug in Gfortran or rather illegal code, see below.
Reproducible both with 4.3.2 and 4.4 snapshot
GNU Fortran (Ubuntu 20081024-0ubuntu1) 4.4.0 20081024 (experimental)
[trunk revision 141342]

Alexei

alexei@lx01:~/darcs/ttfs-mac$ gfortran m.f90
m.f90:18.16:

type :: t3
1
Error: The component 'j' is a PRIVATE type and cannot be a component
of 't3', which is PUBLIC at (1)

alexei@lx01:~/darcs/ttfs-mac$ cat m.f90
module m
implicit none
private

type :: t1
integer :: i
end type

type :: t2
type(t1) :: j
end type

contains

subroutine sub()
implicit none

type :: t3
type(t1) :: j
end type

end subroutine

end module

fj

unread,
Apr 17, 2009, 10:58:59 AM4/17/09
to

Seems to be a bug in gfortran ...

paul.rich...@gmail.com

unread,
Apr 18, 2009, 1:14:44 PM4/18/09
to

> Seems to be a bug in gfortran ...

Tobias Burnus posted it in the gcc bug database as PR39800 -
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39800

You have exposed two bugs - one is F95 and the other is F2003. Please
see PR39800.

Thanks for the report - could you try to post in gcc Bugzilla next
time, please?

Paul

alexei....@gmail.com

unread,
Apr 23, 2009, 5:06:03 PM4/23/09
to
On Apr 18, 7:14 pm, paul.richard.tho...@gmail.com wrote:
> > Seems to be a bug in gfortran ...
>
> Tobias Burnus posted it in the gcc bug database as PR39800 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39800

>
> You have exposed two bugs - one is F95 and the other is F2003. Please
> see PR39800.
>
> Thanks for the report - could you try to post in gcc Bugzilla next
> time, please?
>
> Paul

I am impressed. Here maybe another one:

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

Using module procedure names that collide with the GNU intrinsic
extensions
is not possible even with -std=f95:

alexei@novo:~/$ gfortran -c -std=f95 p.f90
p.f90:19.19:

print *, avg(erfc)
1
Error: Intrinsic 'erfc' at (1) is not allowed as an actual argument
p.f90:19.19:

print *, avg(erfc)
1
Error: Type/rank mismatch in argument 'f' at (1)

0 new messages