This is an archive of the discontinued LLVM Phabricator instance.

[flang] Make extension explicit: exponent-letter matching kind-param
ClosedPublic

Authored by ekieri on May 26 2022, 5:03 AM.

Details

Summary

As an extension for REAL literals, we allow an exponent letter which
matches an explicit kind-param. The standard requires the exponent
to be 'E' if a kind-param is present. This patch

  • documents this extension in Extensions.md
  • enables a portability warning if it is used with -pedantic

The test case for this, kinds05.f90, needs D125804, which makes
test_errors.py test warnings as well, to actually test the warnings.
I include it already now to keep things together, it will do no harm
(I hope ...).

We also add WARNING-directives to the test kinds04.f90 in preparation
for D125804. As the exponent-letter 'Q' does not imply the same kind
on all platforms, the emitted warnings are platform-dependent.
Therefore, the test is duplicated into two variants which are run
conditionally.

Finally, we promote the portability warning for when the exponent letter
is neither 'E' nor matching the kind-param to a standard warning.

Diff Detail

Event Timeline

ekieri created this revision.May 26 2022, 5:03 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
ekieri requested review of this revision.May 26 2022, 5:03 AM
klausler accepted this revision.May 26 2022, 11:25 AM
klausler added inline comments.
flang/lib/Semantics/expression.cpp
578

I know this isn't part of your changes, but perhaps this warning should be a warning rather than a portability note.

This revision is now accepted and ready to land.May 26 2022, 11:25 AM
ekieri marked an inline comment as done.May 28 2022, 1:04 PM
ekieri added inline comments.
flang/lib/Semantics/expression.cpp
578

Yes, I agree.

This revision was automatically updated to reflect the committed changes.
ekieri marked an inline comment as done.
ekieri edited the summary of this revision. (Show Details)May 28 2022, 1:09 PM