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/47768] ICE: printing a derived-type variable with proc-pointer components


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

--- Comment #2 from janus at gcc dot gnu.org 2011-02-16 22:22:03 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > Adding a data pointer component leads to rejection:
> > 
> > print *,x
> >          1
> > Error: Data transfer element at (1) cannot have POINTER components
> > 
> > So I'm guessing the version with proc-pointer is also illegal (haven't checked
> > the standard).
> 
> I have the feeling we reject too much here. F08 says in chapter 9.6.3:
> 
> "If an output item is a pointer, it shall be associated with a target and data
> are transferred from the target to the ïle."
> 
> I think this is the same in F03 and F95.
> So, it seems like pointers are ok (but should be associated), unless I'm
> missing something.

I indeed missed something. Further down in 9.6.3 one finds:

"If a derived-type list item is not processed by a deïned input/output
procedure and is not treated as a list of its individual components, all the
subcomponents of that list item shall be accessible in the scoping unit
containing the input/output statement and shall not be pointers or
allocatable."

So, pointer components are indeed forbidden. All that's left to do here is to
also reject procedure pointers and procedure pointer components.


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