[flang] Semantics checker for STOP and ERROR STOP statements - trust in implied check
authorPaul Osmialowski <pawel.osmialowski@arm.com>
Tue, 16 Apr 2019 22:17:22 +0000 (23:17 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Apr 2019 21:13:23 +0000 (14:13 -0700)
Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>
Original-commit: flang-compiler/f18@7a98732f72649e65fdb1a286ae976aa3f3a9d4a0
Reviewed-on: https://github.com/flang-compiler/f18/pull/367

flang/lib/semantics/check-stop.cc

index 8a9cbd4..1e24ab3 100644 (file)
@@ -23,8 +23,7 @@
 namespace Fortran::semantics {
 
 void StopChecker::Enter(const parser::StopStmt &stmt) {
-  if (const auto &stopCode{std::get<std::optional<parser::StopCode>>(stmt.t)};
-      stopCode.has_value()) {
+  if (const auto &stopCode{std::get<std::optional<parser::StopCode>>(stmt.t)}) {
     const parser::CharBlock &source{stopCode.value().v.thing.source};
     const auto &expr{*(stopCode.value().v.thing.typedExpr)};