public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/44925]  New: [OOP] CLASS pointer reported unassociated to C_LOC
@ 2010-07-12 20:52 barron dot bichon at swri dot org
  2010-07-12 21:10 ` [Bug fortran/44925] [OOP] C_LOC with CLASS pointer janus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: barron dot bichon at swri dot org @ 2010-07-12 20:52 UTC (permalink / raw)
  To: gcc-bugs

Consider the following code:

module test

  type :: t
  end type t

  type, extends(t) :: tt
  end type tt

contains

  subroutine get_cptr(tt_cptr)
    use iso_c_binding
    type(c_ptr) :: tt_cptr
    class(t), pointer :: tt_fptr
    allocate(tt::tt_fptr)
    if (associated(tt_fptr)) tt_cptr = c_loc(tt_fptr)
  end subroutine get_cptr

end module test

At compile-time (using gcc trunk r162082) this gives "Error: Parameter
'tt_fptr' to 'c_loc' at (1) must be either a TARGET or an associated pointer"
even though it has to pass the "if (associated(tt_fptr))" test to execute the
"c_loc" function.


-- 
           Summary: [OOP] CLASS pointer reported unassociated to C_LOC
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: barron dot bichon at swri dot org


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


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

end of thread, other threads:[~2010-07-14  8:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12 20:52 [Bug fortran/44925] New: [OOP] CLASS pointer reported unassociated to C_LOC barron dot bichon at swri dot org
2010-07-12 21:10 ` [Bug fortran/44925] [OOP] C_LOC with CLASS pointer janus at gcc dot gnu dot org
2010-07-13  9:45 ` janus at gcc dot gnu dot org
2010-07-13 11:11 ` janus at gcc dot gnu dot org
2010-07-13 11:52 ` burnus at gcc dot gnu dot org
2010-07-13 12:04 ` burnus at gcc dot gnu dot org
2010-07-13 12:13 ` janus at gcc dot gnu dot org
2010-07-13 12:32 ` janus at gcc dot gnu dot org
2010-07-13 13:54 ` janus at gcc dot gnu dot org
2010-07-13 15:54 ` burnus at gcc dot gnu dot org
2010-07-14  8:09 ` janus at gcc dot gnu dot org
2010-07-14  8:16 ` janus at gcc dot gnu dot 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).