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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, diagnostic
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-13 
09:37:39 UTC ---
c the following is wrong: the MOLD formal argument of null() is required
c gfortran simply picks the last routine defined in the interface, in this case
s2

Which is consistent with NAG, Open64 and PathScale. With ifort and g95 one gets
the expected error message:

      call gen(null())
               1
Error: Typeless NULL() at (1) must have a MOLD argument
      call gen(null())
           1
Error: Generic subroutine 'gen' at (1) is not consistent with a specific
subroutine interface


error #6285: There is no matching specific subroutine for this generic
subroutine call.   [GEN]

 * * *

>From F2008's 13.7.125 NULL ([MOLD]):

"If MOLD is absent, the characteristics of the result are determined by the
entity with which the reference is associated. See Table 13.2. MOLD shall not
be absent in any other context. [...]"

"If the context of the reference to NULL is an actual argument in a generic
procedure reference, MOLD shall be present if the type, type parameters, or
rank are required to resolve the generic reference."


"Table 13.2: Characteristics of the result of NULL ( )
  Appearance of NULL ( )                    Type, type parameters,
                                            and rank of result:
  right side of a pointer assignment        pointer on the left side
  initialization for an object in a declaration   the object
  default initialization for a component    the component
  in a structure constructor                the corresponding component
  as an actual argument                     the corresponding dummy argument
  in a DATA statement                       the corresponding pointer object"

Reply via email to