[Flang] Incorrect diagnose of DATA statement to initialize implicitly typed and subscripted components
Consider the following code:
PROGRAM Data2
IMPLICIT TYPE(DT)(V)
TYPE :: DT
INTEGER :: Id
PROCEDURE(), NOPASS, POINTER :: ProcPtr
END TYPE
DIMENSION V1(3)
DATA V1(1)%ProcPtr /NULL()/
DATA V1(1)%Id /4/
end
Flang currently issues error messages for both DATA statement.
error: Semantic errors in t.f
./t.f:8:14: error: Internal: no symbol found for 'procptr'
DATA V1(1)%ProcPtr /NULL()/
^^^^^^^
./t.f:9:14: error: Internal: no symbol found for 'id'
DATA V1(1)%Id /4/
^^
This seems incorrect.
- If I change
V1to be explicitly typed, it compiles successfully, or - if I change
V1to be scalar, it compiles successfully.
@llvm/issue-subscribers-flang-frontend
Author: Daniel Chen (DanielCChen)
Flang currently issues error messages for both DATA statement.
error: Semantic errors in t.f
./t.f:8:14: error: Internal: no symbol found for 'procptr'
DATA V1(1)%ProcPtr /NULL()/
^^^^^^^
./t.f:9:14: error: Internal: no symbol found for 'id'
DATA V1(1)%Id /4/
^^
This seems incorrect.
- If I change
V1to be explicitly typed, it compiles successfully, or - if I change
V1to be scalar, it compiles successfully.
@llvm/issue-subscribers-bug
Author: Daniel Chen (DanielCChen)
Flang currently issues error messages for both DATA statement.
error: Semantic errors in t.f
./t.f:8:14: error: Internal: no symbol found for 'procptr'
DATA V1(1)%ProcPtr /NULL()/
^^^^^^^
./t.f:9:14: error: Internal: no symbol found for 'id'
DATA V1(1)%Id /4/
^^
This seems incorrect.
- If I change
V1to be explicitly typed, it compiles successfully, or - if I change
V1to be scalar, it compiles successfully.
https://github.com/llvm/llvm-project/pull/82825
I have verified PR #82825 fixed the reproducer and the original test case. Thanks for the quick fix! @klausler