Skip to content

Improve checker for ReferenceModifier #1991

@fm-117

Description

@fm-117

IBM compiler allows decimal values in reference modifiers and emits an error when using negative values.

In our current implementation, no diagnostic is created for both of these cases. To improve our error reporting, we should:

  • emit an error on negative index/length (same for zero index or length)
  • emit a warning on decimal index/length

Code to check:

           MOVE item(0:5) TO part
           MOVE item(1:0) TO part
           MOVE item(0:0) TO part
           MOVE item(-1:5) TO part
           MOVE item(1:-5) TO part
           MOVE item(-1:-5) TO part
           MOVE item(1.32:5) TO part
           MOVE item(1:5.84) TO part
           MOVE item(1.32:5.84) TO part
           MOVE item(0.0:5) TO part
           MOVE item(1:0.0) TO part
           MOVE item(0.0:0.0) TO part
           MOVE item(-1.32:5) TO part
           MOVE item(1:-5.84) TO part
           MOVE item(-1.32:-5.84) TO part

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions