public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47360] New: GENERIC with proc-pointer components as specific functions
@ 2011-01-19 16:13 burnus at gcc dot gnu.org
  2011-01-19 16:19 ` [Bug fortran/47360] " burnus at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-19 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: GENERIC with proc-pointer components as specific
                    functions
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Related to PR 47352. 

Both where reported by James in the same thread:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/bbaf59ffd7c372e9


The program in question fails with

         GENERIC :: gen => f1, g1
                          1
  Error: Undefined specific binding 'g1' as target of GENERIC 'gen' at (1)


At a glance, the program looks as if it could be valid - though also Crayftn
does not like it (ifort 11 and NAG f95 5.1 do not support GENERIC, yet).


module mytypes
   implicit none
   abstract interface
      function f(x)
         real f, x
      end function f
      function g(x)
         integer g, x
      end function g
   end interface
   type T
      procedure(f),pointer,NOPASS :: f1
      procedure(g),pointer,NOPASS :: g1
      contains
         GENERIC :: gen => f1, g1
   end type T
end module mytypes

module funcs
   implicit none
   contains
      function f(x)
         real f, x
         f = 3*x
      end function f
      function g(x)
         integer g, x
         g = 3*x
      end function g
end module funcs

program test
   use mytypes
   use funcs, f2=>f, g2=>g
   implicit none
   type(T) tau

   tau%f1 => f2
   tau%g1 => g2
   write(*,*) tau%gen(1)
   write(*,*) tau%gen(1.0)
end program test


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/47360] GENERIC with proc-pointer components as specific functions
  2011-01-19 16:13 [Bug fortran/47360] New: GENERIC with proc-pointer components as specific functions burnus at gcc dot gnu.org
@ 2011-01-19 16:19 ` burnus at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-19 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-19 16:04:43 UTC ---
"R450 type-bound-generic-stmt
      is GENERIC [ , access-spec ] :: generic-spec => binding-name-list"

"C467 (R450) Each binding-name in binding-name-list shall be the name of
             a specific binding of the type."

"1.3.13 binding name: name given to a specific or generic type-bound procedure
in the type definition (4.5.5)"

And in 4.5.5:
"R447 type-bound-proc-binding is type-bound-procedure-stmt
                              or type-bound-generic-stmt
                              or final-procedure-stmt"

Hence, the example seems to be invalid as "f1" and "g1" are not type-bound
procedures. -> Close PR.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-19 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19 16:13 [Bug fortran/47360] New: GENERIC with proc-pointer components as specific functions burnus at gcc dot gnu.org
2011-01-19 16:19 ` [Bug fortran/47360] " burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).