forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Ensure names resolve in DATA statement objects (llvm#82825)
When DATA statement objects have derived types obtained by implicit typing rules, their types aren't known until specification part processing is complete. In the case of a derived type, any component name in a designator may still be in need of name resolution. Take care of it in the deferred check visitor that runs at the end of name resolution in each specification and execution part. Fixes llvm#82069.
- Loading branch information
Showing
2 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s | ||
! Ensure that implicitly typed DATA statement objects with derived | ||
! types get their symbols resolved by the end of the name resolution pass. | ||
! CHECK: x1 (Implicit, InDataStmt) size=4 offset=0: ObjectEntity type: TYPE(t1) shape: 1_8:1_8 init:[t1::t1(n=123_4)] | ||
! CHECK: x2 (InDataStmt) size=4 offset=4: ObjectEntity type: TYPE(t2) shape: 1_8:1_8 init:[t2::t2(m=456_4)] | ||
implicit type(t1)(x) | ||
type t1 | ||
integer n | ||
end type | ||
dimension x1(1), x2(1) | ||
data x1(1)%n /123/ | ||
data x2(1)%m /456/ | ||
type t2 | ||
integer m | ||
end type | ||
type(t2) x2 | ||
end |