This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52227] [OOP] TARGET attribute mishandled in polymorphic types
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Feb 2012 20:59:06 +0000
- Subject: [Bug fortran/52227] [OOP] TARGET attribute mishandled in polymorphic types
- Auto-submitted: auto-generated
- References: <bug-52227-4@http.gcc.gnu.org/bugzilla/>
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"