This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45420] [OOP] poylmorphic TBP calls in a CLASS DEFAULT clause
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2010 17:54:40 -0000
- Subject: [Bug fortran/45420] [OOP] poylmorphic TBP calls in a CLASS DEFAULT clause
- References: <bug-45420-16146@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from janus at gcc dot gnu dot org 2010-08-26 17:54 -------
The dump shows that the first call to 'get_fmt' is executed dynamically as
'a.$vptr->get_fmt(...)', while the ones inside the SELECT TYPE block are
resolved statically to 'd_base_get_fmt'. For the TYPE IS clause this is fine,
but not so for CLASS DEFAULT, where a polymorphic call should be generated.
F08 quotes (chapter 8.1.9.2):
Within the block following a TYPE IS type guard statement, the associating
entity (16.5.5) is not polymorphic (4.3.1.3), has the type named in the type
guard statement, and has the type parameter values of the selector.
Within the block following a CLASS IS type guard statement, the associating
entity is polymorphic and has the declared type named in the type guard
statement. The type parameter values of the associating entity are the
corresponding type parameter values of the selector.
Within the block following a CLASS DEFAULT type guard statement, the
associating entity is polymorphic and has the same declared type as the
selector. The type parameter values of the associating entity are those of the
declared type of the selector.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45420