public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/48887] New: [OOP] SELECT TYPE:  Associate name shall not be a pointer/allocatable
@ 2011-05-05 13:11 burnus at gcc dot gnu.org
  2011-05-06 17:28 ` [Bug fortran/48887] " domob at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-05 13:11 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [OOP] SELECT TYPE:  Associate name shall not be a
                    pointer/allocatable
           Product: gcc
           Version: 4.7.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, domob@gcc.gnu.org


>From F2008, 16.5.1.6 Construct association:

"If the selector is allocatable, it shall be allocated; the associate name is
associated with the data object and does not have the ALLOCATABLE attribute.

"If the selector has the POINTER attribute, it shall be associated; the
associate name is associated with the target of the pointer and does not have
the POINTER attribute."


However, gfortran accepts the following, ifort and NAG don't.

It works if the associate name is explicitly given using "associate-name =>
selector"; however, it does not change the POINTER/ALLOCATABLE issue as: "The
associate name of a SELECT TYPE construct is the associate-name if specified;
otherwise it is the name that constitutes the selector."


type t
end type t
class(t), allocatable :: alloc
class(t), pointer     :: ptr

select type(alloc)
type is (t)
  allocate(alloc) ! INVALID: "alloc" is not allocatable
end select

select type(ptr)
type is (t)
  nullify(ptr) ! INVALID: "ptr" is not a pointer
end select

end

For an longer example, see 
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/88b65a2c9024e95f


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

end of thread, other threads:[~2011-12-03 18:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-05 13:11 [Bug fortran/48887] New: [OOP] SELECT TYPE: Associate name shall not be a pointer/allocatable burnus at gcc dot gnu.org
2011-05-06 17:28 ` [Bug fortran/48887] " domob at gcc dot gnu.org
2011-05-27 11:04 ` domob at gcc dot gnu.org
2011-06-16 14:33 ` janus at gcc dot gnu.org
2011-12-02 16:22 ` [Bug fortran/48887] [4.7 Regression][OOP] " burnus at gcc dot gnu.org
2011-12-03 18:32 ` burnus at gcc dot gnu.org
2011-12-03 18:35 ` 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).