public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
@ 2012-05-11 21:36 burnus at gcc dot gnu.org
  2012-05-11 22:16 ` [Bug fortran/53328] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-11 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53328
           Summary: [OOP] Ambiguous check for type-bound GENERIC shall
                    ignore PASSed arguments
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org


Based on a report by Rafik Zurob.

Compile the following module - and then the following:
  use m
  type(t) :: x
  call x%gen(5)
  end
Does the call invoke sub1 or sub2?


Obviously, gfortran should ignore the PASSed argument for the generic
resolution of type-bound procedures, when checking for ambiguity.


The following code is invalid but accepted:

module m
  type t
  contains
    procedure, pass(this) :: sub1
    procedure, pass(this) :: sub2
    generic :: gen => sub1, sub2
  end type t
contains
  subroutine sub1(x, this)
    integer :: i
    class(t) :: this
  end subroutine sub1

  subroutine sub2 (this, y)
    integer :: i
    class(t) :: this
  end subroutine sub2
end module m


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

* [Bug fortran/53328] [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
  2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
@ 2012-05-11 22:16 ` burnus at gcc dot gnu.org
  2012-05-12 18:06 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-11 22:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-11 21:42:00 UTC ---
See Fortran 2003, 16.2.3 for details.

(For type-bound operators, the PASS argument itself also plays a role in
distinguishing the calls - thus, it cannot completely be ignored. For
type-bound generic names, I think the PASS argument should be always be
indistinguishable.)


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

* [Bug fortran/53328] [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
  2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
  2012-05-11 22:16 ` [Bug fortran/53328] " burnus at gcc dot gnu.org
@ 2012-05-12 18:06 ` burnus at gcc dot gnu.org
  2012-06-17 16:40 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-05-12 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-12 17:59:36 UTC ---
Extended examples: http://gcc.gnu.org/ml/fortran/2012-05/msg00060.html


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

* [Bug fortran/53328] [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
  2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
  2012-05-11 22:16 ` [Bug fortran/53328] " burnus at gcc dot gnu.org
  2012-05-12 18:06 ` burnus at gcc dot gnu.org
@ 2012-06-17 16:40 ` janus at gcc dot gnu.org
  2012-06-22 21:06 ` janus at gcc dot gnu.org
  2012-06-22 21:11 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-17 16:40 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-06-17
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from janus at gcc dot gnu.org 2012-06-17 16:40:10 UTC ---
Taking this one. Patch: http://gcc.gnu.org/ml/fortran/2012-06/msg00111.html


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

* [Bug fortran/53328] [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
  2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-06-17 16:40 ` janus at gcc dot gnu.org
@ 2012-06-22 21:06 ` janus at gcc dot gnu.org
  2012-06-22 21:11 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-22 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from janus at gcc dot gnu.org 2012-06-22 21:05:55 UTC ---
Author: janus
Date: Fri Jun 22 21:05:51 2012
New Revision: 188902

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188902
Log:
2012-06-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/47710
    PR fortran/53328
    * interface.c (count_types_test, generic_correspondence,
    gfc_compare_interfaces): Ignore PASS arguments.
    (check_interface1, compare_parameter): Pass NULL arguments to
    gfc_compare_interfaces.
    * gfortran.h (gfc_compare_interfaces): Modified prototype.
    * expr.c (gfc_check_pointer_assign): Pass NULL arguments to
    gfc_compare_interfaces.
    * resolve.c (resolve_structure_cons): Ditto.
    (check_generic_tbp_ambiguity): Determine PASS arguments and pass them
    to gfc_compare_interfaces.


2012-06-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/47710
    PR fortran/53328
    * gfortran.dg/typebound_generic_12.f03: New.
    * gfortran.dg/typebound_generic_13.f03: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/typebound_generic_12.f03
    trunk/gcc/testsuite/gfortran.dg/typebound_generic_13.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/53328] [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments
  2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-06-22 21:06 ` janus at gcc dot gnu.org
@ 2012-06-22 21:11 ` janus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2012-06-22 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from janus at gcc dot gnu.org 2012-06-22 21:10:51 UTC ---
Fixed with r188902. Closing.


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

end of thread, other threads:[~2012-06-22 21:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 21:36 [Bug fortran/53328] New: [OOP] Ambiguous check for type-bound GENERIC shall ignore PASSed arguments burnus at gcc dot gnu.org
2012-05-11 22:16 ` [Bug fortran/53328] " burnus at gcc dot gnu.org
2012-05-12 18:06 ` burnus at gcc dot gnu.org
2012-06-17 16:40 ` janus at gcc dot gnu.org
2012-06-22 21:06 ` janus at gcc dot gnu.org
2012-06-22 21:11 ` 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).