linked lists/trees with type-bound procedures
Steve Kargl
sgk@troutmask.apl.washington.edu
Tue Aug 24 16:13:00 GMT 2010
On Tue, Aug 24, 2010 at 08:34:55AM -0700, Mark Rashid wrote:
>
> Under gfortran 4.5, there appears to be a problem defining derived types
> that have type-bound procedures, and that also have one or more pointers to
> components of the same type being defined (i.e. "link pointers"). (This
> you need to do if you want a linked list or search tree whose nodes are
> objects with type-bound procedures.) In the derived-type definition, if
> you specify the pointer to the type being defined using CLASS (as is
> appropriate), then gfortran throws an error on compilation, saying that the
> "passed-object dummy argument of '[type-bound-proc]' must not be POINTER."
> This, even though the argument of the type-bound procedure in question is
> declared in the procedure using CLASS (per the standard) but without the
> POINTER attribute. Changing from CLASS to TYPE for the link pointer in the
> original derived-type definition eliminates this compilation error, but
> then causes other untold problems. By my reading of the standard (but
> please correct if you believe otherwise), it should be possible to define
> link pointers in derived types using CLASS, and this is in fact appropriate
> if the derived type has type-bound procedures. Will be grateful for any help.
Have you tried a gfortran based on trunk (aka 4.6.0)?
What is the URL to the code that demonstrates the
problem? While it might be possible for one of us
to write Fortran code based on your description to
demonstrate the issue, doing so would not be a good
use of the very limited time that the developers
have.
--
Steve
More information about the Fortran
mailing list