public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57217] New: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check
@ 2013-05-08 17:32 burnus at gcc dot gnu.org
  2013-05-09  9:55 ` [Bug fortran/57217] " burnus at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-05-08 17:32 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 57217
           Summary: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP
                    overriding - lacking arguments check
    Classification: Unclassified
           Product: gcc
           Version: 4.9.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, salvatore.filippone@uniroma2.it


Reported by Salvatore; very vaguely related to PR47978.

In the following program, "clone" is overridden. The overridden procedure shall
use for the dummy arguments "CLASS(base_type)" instead of "CLASS(r_type)" as in
the original TBP - except for the PASS argument, which may be different.


GCC 4.6 prints:
    procedure, pass(map)  :: clone    => r_clone
             1
Error: Types mismatch for dummy argument 'mapout' of 'clone' (1) in respect to
the overridden procedure


F2008, "4.5.7.3 Type-bound procedure overriding":
"The overriding and overridden type-bound procedures shall satisfy the
following conditions.
[...] * Dummy arguments that correspond by position shall have the same names
and characteristics, except for the type of the passed-object dummy arguments."


module base_mod
  type base_type
    integer :: kind
  contains
    procedure, pass(map)  :: clone    => base_clone
  end type base_type
contains
  subroutine  base_clone(map,mapout,info)
    implicit none
    class(base_type), intent(inout) :: map
    class(base_type), intent(inout) :: mapout
    integer     :: info
  end subroutine base_clone
end module base_mod

module r_mod
  use base_mod
  type, extends(base_type) :: r_type
    real  :: dat
  contains
    procedure, pass(map)  :: clone    => r_clone
  end type r_type
contains
  subroutine  r_clone(map,mapout,info)
    implicit none
    class(r_type), intent(inout) :: map
    class(r_type), intent(inout) :: mapout
    integer     :: info
  end subroutine r_clone
end module r_mod


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

end of thread, other threads:[~2013-06-01 21:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-08 17:32 [Bug fortran/57217] New: [4.7/4.8/4.9 Regression][OOP] Accepts invalid TBP overriding - lacking arguments check burnus at gcc dot gnu.org
2013-05-09  9:55 ` [Bug fortran/57217] " burnus at gcc dot gnu.org
2013-05-10 16:56 ` burnus at gcc dot gnu.org
2013-05-15 13:29 ` rguenth at gcc dot gnu.org
2013-05-28  7:15 ` janus at gcc dot gnu.org
2013-05-28 11:53 ` janus at gcc dot gnu.org
2013-05-28 12:06 ` janus at gcc dot gnu.org
2013-05-29 21:16 ` janus at gcc dot gnu.org
2013-05-29 21:39 ` janus at gcc dot gnu.org
2013-05-31  8:16 ` janus at gcc dot gnu.org
2013-05-31 18:13 ` janus at gcc dot gnu.org
2013-06-01 21:39 ` 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).