Skip to content

Commit 0d6a67c

Browse files
authored
[flang][runtime] Remove redundant initialization (#150984)
The assignment to mutableModes() in BeginIoStatement() is redundant, since the mutableModes_ data member is initialized by the constructors of the two classes that now have one. Remove the assignment to avoid confusion. Also restores the original OutputStatementState base class name after a recent patch that needlessly changed it to something equivalent but less readable.
1 parent ec0c79d commit 0d6a67c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

flang-rt/include/flang-rt/runtime/io-stmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ class InquireUnconnectedFileState : public NoUnitIoStatementState {
856856
};
857857

858858
class InquireIOLengthState : public NoUnitIoStatementState,
859-
public IoDirectionState<Direction::Output> {
859+
public OutputStatementState {
860860
public:
861861
RT_API_ATTRS InquireIOLengthState(
862862
const char *sourceFile = nullptr, int sourceLine = 0);

flang-rt/lib/runtime/unit.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ class ExternalFileUnit : public ConnectionState,
161161
lock_.Take();
162162
#endif
163163
A &state{u_.emplace<A>(std::forward<X>(xs)...)};
164-
if constexpr (!std::is_same_v<A, OpenStatementState>) {
165-
state.mutableModes() = ConnectionState::modes;
166-
}
167164
directAccessRecWasSet_ = false;
168165
io_.emplace(state);
169166
return *io_;

0 commit comments

Comments
 (0)