Index: flang/lib/Semantics/tools.cpp =================================================================== --- flang/lib/Semantics/tools.cpp +++ flang/lib/Semantics/tools.cpp @@ -875,11 +875,11 @@ } class ImageControlStmtHelper { - using ImageControlStmts = std::variant; + using ImageControlStmts = + std::variant; public: template bool operator()(const T &) { @@ -929,6 +929,11 @@ } return false; } + bool operator()(const parser::StopStmt &stmt) { + // STOP is an image control statement; ERROR STOP is not + return std::get(stmt.t) == + parser::StopStmt::Kind::Stop; + } bool operator()(const parser::Statement &stmt) { return common::visit(*this, stmt.statement.u); }