[flang] Initialize PRINT semantics. Fixes flang-compiler/f18#516 (flang-compiler...
authorvdonaldson <37090318+vdonaldson@users.noreply.github.com>
Wed, 26 Jun 2019 22:46:48 +0000 (15:46 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Jun 2019 22:46:48 +0000 (15:46 -0700)
There are no Clause 12 constraints to check for PRINT, but PRINT does share
FMT specifier processing with READ and WRITE.  To avoid interactions between
these I/O statements, reset IoChecker values for PRINT.

Original-commit: flang-compiler/f18@6a547667187e2832c8c162d4ee02835ff4c190b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/528

flang/lib/semantics/check-io.h
flang/test/semantics/io03.f90

index c549b0e..e21f36d 100644 (file)
@@ -35,6 +35,7 @@ public:
   void Enter(const parser::FlushStmt &) { Init(IoStmtKind::Flush); }
   void Enter(const parser::InquireStmt &) { Init(IoStmtKind::Inquire); }
   void Enter(const parser::OpenStmt &) { Init(IoStmtKind::Open); }
+  void Enter(const parser::PrintStmt &) { Init(IoStmtKind::Print); }
   void Enter(const parser::ReadStmt &) { Init(IoStmtKind::Read); }
   void Enter(const parser::RewindStmt &) { Init(IoStmtKind::Rewind); }
   void Enter(const parser::WaitStmt &) { Init(IoStmtKind::Wait); }
index 9df7e0b..5403b23 100644 (file)
@@ -31,6 +31,7 @@
   open(10)
 
   read*
+  print*, 'Ok'
   read(*)
   read*, jj
   read(*, *) jj