------- Comment #1 from burnus at gcc dot gnu dot org  2009-06-15 07:46 -------
Paul, I CC you as you are our generic-resolution expert.

 * * *

gfortran 4.1 to 4.5, NAG f95 5.1, g95, ifort 11, openf95, Sun Studio 12 all
print the following:

E
S, S
E
E, E   ! << you expect an "S, S" here

Looking at the following excerpt from Fortran 2003, it looks indeed as if all
the compiler get it wrong. Especially, the standard does not assume (to my
reading) that the generic resolution depends on the order. However, before
changing it, one needs to double check - that several compiler gets it wrong
and (of my collection) none gets it correct also happens only rarely.

 * * *

"12.4.4.1 Resolving procedure references to names established to be generic

"(1) If the reference is consistent with a nonelemental reference to one of the
specific interfaces of a generic interface that has that name and either is in
the scoping unit in which the reference appears or is made accessible by a USE
statement in the scoping unit, the reference is to the specific procedure in
the interface block that provides that interface. The rules in 16.2.3 ensure
that there can be at most one such specific procedure.

 (2) If (1) does not apply, if the reference is consistent with an elemental
reference to one of the specific interfaces of a generic interface that has
that name and either is in the scoping unit in which the reference appears or
is made accessible by a USE statement in the scoping unit, the reference is to
the specific elemental procedure in the interface block that provides that
interface. The rules in 16.2.3 ensure that there can be at most one such
specific elemental procedure."


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu dot
                   |                            |org, burnus at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i586-pc-mingw32             |
   GCC host triplet|i586-pc-mingw32             |
 GCC target triplet|i586-pc-mingw32             |
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2009-06-15 07:46:13
               date|                            |


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

Reply via email to