public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56845] New: [OOP] _vptr not set to declared type for CLASS + SAVE
@ 2013-04-04 19:08 burnus at gcc dot gnu.org
  2013-04-04 20:15 ` [Bug fortran/56845] " janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-04-04 19:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56845
           Summary: [OOP] _vptr not set to declared type for CLASS + SAVE
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@gcc.gnu.org


The program below fails at run time. Unallocated the class should match the
declared type - but it is never set with SAVE.


The dump of the following program shows:
  static struct __class_m_T_a y = {};
Expected:
  static struct __class_m_T_a y = { ._data = 0B, ._vptr = &__vtab_m_T};


module m
type t
integer ::a
end type t
contains
subroutine sub
  type(t), save, allocatable :: x
  class(t), save,allocatable :: y
  if (.not. same_type_as(x,y)) call abort()
end subroutine sub
subroutine sub2
  type(t), save, allocatable :: a(:)
  class(t), save,allocatable :: b(:)
  if (.not. same_type_as(a,b)) call abort()
end subroutine sub2
end module m

use m
call sub()
call sub2()
end


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

end of thread, other threads:[~2013-04-12  9:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04 19:08 [Bug fortran/56845] New: [OOP] _vptr not set to declared type for CLASS + SAVE burnus at gcc dot gnu.org
2013-04-04 20:15 ` [Bug fortran/56845] " janus at gcc dot gnu.org
2013-04-04 21:01 ` janus at gcc dot gnu.org
2013-04-04 21:24 ` janus at gcc dot gnu.org
2013-04-05  8:44 ` burnus at gcc dot gnu.org
2013-04-12  7:42 ` burnus at gcc dot gnu.org
2013-04-12  7:42 ` burnus at gcc dot gnu.org
2013-04-12  9:23 ` 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).