public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected
@ 2011-06-30 12:53 burnus at gcc dot gnu.org
  2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-30 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [OOP] Multiple identical specific procedures in
                    type-bound generic not detected
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org


The first code ("module M1") is accepted without any error.
Expected: Diagnose that the generic operator (+) has two ambiguous specific
bindings, one to myadd_t the other to myadd_x.

Ditto for the second code ("M2"), which is also currently accepted.



  module M1
    type T
      integer x
    contains
      procedure :: MyAdd_t => myadd
      generic :: operator(+) => myAdd_t
    end type T
    type X
      real q
    contains
      procedure, pass(b) :: MyAdd_x => myadd
      generic :: operator(+) => myAdd_x
    end type X
  contains
    integer function MyAdd ( A, B )
      class(t), intent(in) :: A
      class(x), intent(in) :: B
      myadd = a%x + b%q
    end function MyAdd
  end module

  module M2
    interface operator(+)
      procedure MyAdd
    end interface
    type T
      integer x
    contains
      procedure :: MyAdd_t => myadd
      generic :: operator(+) => myAdd_t
    end type T
  contains
    integer function MyAdd ( A, B )
      class(t), intent(in) :: A
      real, intent(in) :: B
      myadd = a%x + b
    end function MyAdd
  end module


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

end of thread, other threads:[~2012-06-27 17:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 12:53 [Bug fortran/49591] New: [OOP] Multiple identical specific procedures in type-bound generic not detected burnus at gcc dot gnu.org
2011-08-04 16:50 ` [Bug fortran/49591] [OOP] Multiple identical specific procedures in type-bound operator " janus at gcc dot gnu.org
2011-08-04 19:36 ` burnus at gcc dot gnu.org
2011-08-04 19:40 ` burnus at gcc dot gnu.org
2011-08-04 20:06 ` janus at gcc dot gnu.org
2012-06-25 19:06 ` janus at gcc dot gnu.org
2012-06-27 17:38 ` janus at gcc dot gnu.org
2012-06-27 17:51 ` janus 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).