public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment)
@ 2013-12-06 18:53 antony at cosmologist dot info
  2013-12-07 11:12 ` [Bug fortran/59414] [OOP] " janus at gcc dot gnu.org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: antony at cosmologist dot info @ 2013-12-06 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59414
           Summary: Class array pointers: compile error on valid code
                    (Different ranks in pointer assignment)
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

Created attachment 31394
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31394&action=edit
OOP module implementing lists of arrays of objects

Compiler errors like

ObjectLists.f90:597.4:

    Item => L%ArrayItem(i)
    1
Error: Different ranks in pointer assignment at (1)


Code is a class array pointer to a function that returns a class array pointer:

    function ArrayItem(L, i) result(P)
    Class(TObjectList) :: L
    integer, intent(in) :: i
    Class(*), pointer :: P(:)

    select type (Point=> L%Items(i)%P)
    class is (object_array_pointer)
        P => Point%P
        class default
        stop 'TObjectList: item is not array item'
    end select

    end function ArrayItem

 ...
  class(*), pointer :: Item(:)

  Item => L%ArrayItem(i)

Code is valid and works with the Intel compiler. Complete generic list module
attached (from the widely-used but currently not gfortran-compiling CosmoMC
parameter estimation package).


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

end of thread, other threads:[~2014-02-01 22:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-06 18:53 [Bug fortran/59414] New: Class array pointers: compile error on valid code (Different ranks in pointer assignment) antony at cosmologist dot info
2013-12-07 11:12 ` [Bug fortran/59414] [OOP] " janus at gcc dot gnu.org
2013-12-07 11:56 ` janus at gcc dot gnu.org
2013-12-07 12:33 ` antony at cosmologist dot info
2013-12-07 12:46 ` janus at gcc dot gnu.org
2013-12-07 14:04 ` dominiq at lps dot ens.fr
2013-12-07 14:26 ` janus at gcc dot gnu.org
2013-12-07 15:13 ` janus at gcc dot gnu.org
2013-12-07 16:59 ` kargl at gcc dot gnu.org
2013-12-07 19:27 ` janus at gcc dot gnu.org
2013-12-07 19:30 ` janus at gcc dot gnu.org
2013-12-19 15:21 ` [Bug fortran/59414] [4.8/4.9 Regression] [OOP] ICE in in gfc_conv_expr_descriptor on ALLOCATE inside SELECT TYPE rguenth at gcc dot gnu.org
2014-01-19 12:34 ` pault at gcc dot gnu.org
2014-01-19 21:06 ` pault at gcc dot gnu.org
2014-01-26 14:31 ` mikael at gcc dot gnu.org
2014-01-26 17:41 ` paul.richard.thomas at gmail dot com
2014-01-28 20:11 ` pault at gcc dot gnu.org
2014-01-28 20:18 ` [Bug fortran/59414] [4.8 " pault at gcc dot gnu.org
2014-02-01 22:32 ` pault at gcc dot gnu.org
2014-02-01 22:34 ` pault 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).