[flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]
authorpeter klausler <pklausler@nvidia.com>
Fri, 30 Oct 2020 19:53:42 +0000 (12:53 -0700)
committerpeter klausler <pklausler@nvidia.com>
Fri, 30 Oct 2020 22:47:28 +0000 (15:47 -0700)
commit4acd8f7f0a7ef4009fe039297335b931ab9e62d0
treebc98ae4c31bc92f5ae993721ac38e50ecbcd8627
parent1cb0b5660777cb563637ff6bb80722f449ee97eb
[flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]

READ(CVAR)[,item-list] with a character variable CVAR
could be parsed as an unformatted READ from an internal
unit or as a formatted READ from the default external unit
with a needlessly parenthesized variable format.  We parse
it as the former, but Fortran doesn't have unformatted
internal I/O.

Differential revision: https://reviews.llvm.org/D90493
flang/lib/Parser/io-parsers.cpp
flang/lib/Semantics/rewrite-parse-tree.cpp
flang/test/Semantics/rewrite01.f90 [new file with mode: 0644]