Skip to content

Commit 9fa048e

Browse files
committed
remove accidental commit and add negative test
1 parent 3498600 commit 9fa048e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

flang-rt/lib/runtime/io-stmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ template <Direction DIR>
11091109
bool ChildListIoStatementState<DIR>::AdvanceRecord(int n) {
11101110
#if !defined(RT_DEVICE_AVOID_RECURSION)
11111111
// Allow child NAMELIST input to advance
1112-
if (DIR == Direction::Input) {
1112+
if (DIR == Direction::Input && this->mutableModes().inNamelist) {
11131113
return this->child().parent().AdvanceRecord(n);
11141114
} else {
11151115
return false;

flang/test/Semantics/intrinsics03.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,12 @@ subroutine s4(ix)
123123
call s4(index3)
124124
call s4(index4) ! ok
125125
end
126+
127+
subroutine ichar_tests()
128+
integer, parameter :: a1 = ichar('B')
129+
!Without -Wportability, the warning isn't emitted and the parameter is constant.
130+
integer, parameter :: a2 = ichar('B ')
131+
!ERROR: Character in intrinsic function ichar must have length one
132+
!ERROR: Must be a constant value
133+
integer, parameter :: a3 = ichar('')
134+
end subroutine

flang/test/Semantics/intrinsics04.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subroutine s(o,a,p)
2727
subroutine ichar_tests()
2828
integer, parameter :: a1 = ichar('B')
2929
!WARNING: Character in intrinsic function ichar should have length one [-Wportability]
30-
integer, parameter :: a = ichar('B ')
30+
integer, parameter :: a2 = ichar('B ')
3131
!ERROR: Character in intrinsic function ichar must have length one
3232
!ERROR: Must be a constant value
3333
integer, parameter :: a3 = ichar('')

0 commit comments

Comments
 (0)