[flang] A minimal PRINT Enter function requires a minimal PRINT Leave function. (flang-compiler/f18#543)

Fixes flang-compiler/f18#541

Original-commit: flang-compiler/f18@8f3c5481e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/543
This commit is contained in:
vdonaldson 2019-07-03 09:59:59 -07:00 committed by GitHub
parent 42831fa6a9
commit a254653536
3 changed files with 9 additions and 0 deletions

View File

@ -497,6 +497,10 @@ void IoChecker::Leave(const parser::OpenStmt &stmt) {
stmt_ = IoStmtKind::None;
}
void IoChecker::Leave(const parser::PrintStmt &stmt) {
stmt_ = IoStmtKind::None;
}
void IoChecker::Leave(const parser::ReadStmt &stmt) {
if (!flags_.test(Flag::IoControlList)) {
return;

View File

@ -78,6 +78,7 @@ public:
void Leave(const parser::FlushStmt &);
void Leave(const parser::InquireStmt &);
void Leave(const parser::OpenStmt &);
void Leave(const parser::PrintStmt &);
void Leave(const parser::ReadStmt &);
void Leave(const parser::RewindStmt &);
void Leave(const parser::WaitStmt &);

View File

@ -21,6 +21,7 @@
integer*8 stat8
integer :: iunit = 10
integer, parameter :: junit = 11
integer, pointer :: a(:)
namelist /nnn/ nn1, nn2
@ -58,6 +59,9 @@
print*
print*, 'Ok'
allocate(a(2), stat=stat2)
allocate(a(8), stat=stat8)
!ERROR: Duplicate UNIT specifier
write(internal_file, unit=*)