Summary: | [OOP] Class container does not properly handle POINTER and TARGET | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | anlauf, janus, pault |
Priority: | P3 | Keywords: | accepts-invalid, rejects-valid |
Version: | 4.7.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2021-12-17 00:00:00 | |
Bug Depends on: | |||
Bug Blocks: | 51605 |
Description
Tobias Burnus
2011-12-18 16:56:16 UTC
With 4.8.1 and trunk, I get pr51610.f90:15.15: ptr => x ! Invalid: "x" is not a TARGET 1 Error: Pointer assignment target is neither TARGET nor POINTER at (1) pr51610.f90:8.23: call test(a, b, c) ! possibly not correctly diagnosed 1 Error: Actual argument for 'z' must be a pointer at (1) Confirmed for 4.7.3. This PR could probably be closed as fixed. Waiting. No feedback since six months. Closing as FIXED. Please open a new PR if I have missed any remaining issue. (In reply to Dominique d'Humieres from comment #3) > No feedback since six months. Closing as FIXED. Please open a new PR if > I have missed any remaining issue. AFAICS, we still get the bogus error: target :: a, b, c 1 Error: Duplicate TARGET attribute specified at (1) > AFAICS, we still get the bogus error: > > target :: a, b, c > 1 > Error: Duplicate TARGET attribute specified at (1) Reduced test: type t end type t class(t), allocatable :: a(:), b(:), c(:) ! Bogus error: Error: Duplicate TARGET attribute specified target :: a, b, c end There is no error if CLASS is replaced with TYPE or REAL. I still think it would be better to have a new PR opened for it. BTW I think the test in comment 1 is invalid due to ... allocate (a(1), b(1), c(1)) ... class(t), target :: y(3) class(t) :: x(3) ... Duplicate. *** This bug has been marked as a duplicate of bug 106856 *** |