This is an archive of the discontinued LLVM Phabricator instance.

[flang] Disallow scalar argument to SIZE/LBOUND/UBOUND
ClosedPublic

Authored by klausler on Mar 21 2023, 3:18 PM.

Details

Summary

The compiler accepts arguments of any rank, or assumed rank, to a host
of intrinsic inquiry functions. For scalars, this is correct for most
of them, but the standard (and other compilers) prohibit scalar arguments
to SIZE, LBOUND, and UBOUND (without DIM=).

There are meaningful interpretations for these intrinsic inquiries
on scalars, but since there's no portability concern here, continuing
to support them would be an unjustifiable extension.

Diff Detail

Event Timeline

klausler created this revision.Mar 21 2023, 3:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 3:18 PM
klausler requested review of this revision.Mar 21 2023, 3:18 PM
PeteSteinfeld accepted this revision.Mar 21 2023, 5:52 PM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Mar 21 2023, 5:52 PM
This revision was automatically updated to reflect the committed changes.

The generics subgroup actually would like to allow scalar arguments to these procedures. It would be an extension for now, but is likely to be standards conforming at some point in the future.

Remind me in 2028.