[flang] Make extension explicit: exponent-letter matching kind-param
authorEmil Kieri <j.emil.kieri@gmail.com>
Fri, 27 May 2022 22:27:59 +0000 (00:27 +0200)
committerEmil Kieri <j.emil.kieri@gmail.com>
Sat, 28 May 2022 20:05:52 +0000 (22:05 +0200)
commitf1983feaa1962b37e590dbf7875481210ace6f17
tree525decf3d20dfad3fbe54ef5b3a4360716dcdbd2
parent50f2e49924566330ea9aa731908f2864603bf4fb
[flang] Make extension explicit: exponent-letter matching kind-param

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.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D126459
flang/docs/Extensions.md
flang/include/flang/Common/Fortran-features.h
flang/lib/Semantics/expression.cpp
flang/test/Semantics/kinds04_q10.f90 [new file with mode: 0644]
flang/test/Semantics/kinds04_q16.f90 [moved from flang/test/Semantics/kinds04.f90 with 61% similarity]
flang/test/Semantics/kinds05.f90 [new file with mode: 0644]