Skip to content

[Flang] Incorrect diagnose of DATA statement to initialize implicitly typed and subscripted components #82069

@DanielCChen

Description

@DanielCChen

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 V1 to be explicitly typed, it compiles successfully, or
  • if I change V1 to be scalar, it compiles successfully.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorflang:frontend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions