7 Commits

Author SHA1 Message Date
Andre Kuhlenschmidt
83b462af17
[flang][CLI] Have the CLI hint the flag to disable a warning (#144767)
Adds a hint to the warning message to disable a warning and updates the
tests to expect this.

Also fixes a bug in the storage of canonical spelling of error flags so
that they are not used after free.
2025-06-30 10:17:05 -07:00
Peter Klausler
53c3a2c69a
[flang] Static checking for empty coarrays (#129610)
A coarray must not have a zero extent on a codimension; that would yield
an empty coarray. When cobounds are constants, verify them.
2025-03-10 13:16:31 -07:00
Peter Klausler
6baf0023ce
[flang] Downgrade recently added error to a warning (#117217)
An empty array shouldn't be subscripted, but sometimes they are in
zero-trip loops in real applications. So change a recently added error
message to a warning (off by default).
2024-12-02 12:24:58 -08:00
Peter Klausler
5242018815
[flang] Catch attempts to subscribe empty arrays (#108246)
An array that has one or more empty dimensions cannot have subscripts
unless there's a possibility that they constitute an empty array
section.

We previously only checked that constant subscripts are in bounds.
2024-09-12 09:11:54 -07:00
Peter Klausler
a5eb6bdd8e
[flang] Relax overindexing error to warning for last dummy dimension (#71725)
Compilation-time subscript value range checking should emit a warning,
not an error, when the indexed array is a dummy argument; there's
old-school codes out there that should have used assumed-size dummy
arguments but didn't.
2023-11-13 15:59:34 -08:00
Peter Klausler
325bd52893 [flang] More subscript triplet checking at compilation time
When a triplet's lower and upper bounds are the same, we can
check them without requiring a constant stride.

Differential Revision: https://reviews.llvm.org/D142943
2023-01-31 08:18:48 -08:00
Peter Klausler
10b990a03b [flang] Diagnose known out-of-range subscripts in more circumstances
Semantics can catch out-of-range subscript values already when they
appear in DATA statement objects and constant folding of name constant
array indexing; this patch fills the gap by checking known constant
subscript values in other contexts.

Differential Revision: https://reviews.llvm.org/D142764
2023-01-28 15:27:17 -08:00