Bug 53951

Summary: [OOP] Later TARGET statement ignored for CLASS
Product: gcc Reporter: Tobias Burnus <burnus>
Component: fortranAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: janus
Priority: P3 Keywords: rejects-valid
Version: 4.8.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2021-12-17 00:00:00

Description Tobias Burnus 2012-07-13 13:12:15 UTC
Related, but slightly different: PR 51610 and PR 52227.


The following program is rejected as the "TARGET B" comes too late:

  C => B ! Valid, but rejected
       1
  Error: Pointer assignment target is neither TARGET nor POINTER at (1)


type t
end type t

class(t), pointer :: C

TARGET :: A
class(t), allocatable :: A, B
TARGET :: B

C => A ! Valid
C => B ! Valid, but rejected
end
Comment 1 Dominique d'Humieres 2013-06-11 19:18:00 UTC
Still present at revision 199959.
Comment 2 anlauf 2023-03-06 17:08:36 UTC
Duplicate.  The testcase in comment#0 is contained in class_74.f90 .

*** This bug has been marked as a duplicate of bug 106856 ***