This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50552] type name cannot be statement function dummy argument (r178939)
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Oct 2011 23:55:49 +0000
- Subject: [Bug fortran/50552] type name cannot be statement function dummy argument (r178939)
- Auto-submitted: auto-generated
- References: <bug-50552-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50552
--- Comment #2 from kargl at gcc dot gnu.org 2011-10-16 23:55:49 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > ! type name cannot be statement function dummy argument (r178939)
> > type t
> > real g
> > end type
> > f(t)=0 ! this should not be accepted
> > end
>
> I can't find anything in the standard that confirms your
> statement. Can you point me to where the standard would
> prohibit the above code?
I should also note that I cannot construct a program, which
actually uses the statement function. All attempts end with
an error message being emitted. I believe that this may be
a non-issue. These 4 programs fail to compile.
! type t
! integer :: i = 42
! end type
! type(t) s
! f(t) = 0
! print *, f(s)
! end
!
! type t
! integer :: i = 42
! end type
! type(t) s
! f(t) = t%i
! print *, f(s)
! end
!
! implicit none
! type t
! integer :: i = 42
! end type
! type(t) s
! f(t) = t%i
! print *, f(s)
! end
!
implicit none
type t
integer :: i = 42
end type
type(t) s
f(t) = 0
print *, f(s)
end