[Patch, Fortran] Two minor tweaks for type-bound procedure parsing

Daniel Kraft d@domob.eu
Sun Aug 24 22:53:00 GMT 2008


Hi,

this patch adds two additional checks to the type-bound procedure 
parsing as commented by Tobias in my other thread; it disallows CONTAINS 
inside derived-types with SEQUENCE/BIND(C) and emits an error if a 
type-bound procedure has the same name as a component of this derived type.

Reading the standard, it seems that this is all that is required for the 
latter case.  I'm wondering what should happen with this:

TYPE :: t1
CONTAINS
   PROCEDURE :: foobar
END TYPE t1

TYPE, EXTENDS(t1) :: t2
   INTEGER :: foobar(42)
END TYPE t2

...

TYPE(t2) :: dt

WRITE (*,*) dt%foobar(5)

Is this allowed?  According to my reading of the standard, it is.  And 
according to my intuition, this should output the array-element and not 
call the type-bound procedure.  What do you think?  Did I miss something 
in the standard and this is not allowed?  If so, I'll incorporate this 
in the patch.

Are there some additional checks that I could add right away to this 
patch?  I'm regression testing at the moment on GNU/Linux-x86-32, ok to 
commit if no regressions and no more comments?

Yours,
Daniel

-- 
Done:     Arc-Bar-Cav-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
To go:    Hea-Kni-Mon-Pri-Ran-Rog-Tou
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080824/5def4fcc/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080824/5def4fcc/attachment-0001.ksh>


More information about the Gcc-patches mailing list