[Bug fortran/52227] [OOP] TARGET attribute mishandled in polymorphic types

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 15 21:20:00 GMT 2012


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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-15 20:59:06 UTC ---
A related issue, for
 class(t), target, allocatable :: a(:)
 target :: a
no error is printed - but it should!

The problem seems to be that already for the first line, the class symbol is
created - and the attr.target does not seem to get stored properly.

The same problem occurs for ALLOCATABLE or POINTER - but only if the variable
is a dummy, otherwise class_ok is false and the creation is deferred. Example:

  type t
  end type t
contains
  subroutine foo(a,b)
    class(t) :: a, b
    allocatable :: a, b
    allocate(a,b)
  end subroutine
end

which fails with "ALLOCATABLE attribute conflicts with POINTER" while using
"pointer" fails with "Duplicate POINTER attribute specified"



More information about the Gcc-bugs mailing list