From dd0f1ff81dc1ca80129d9de9494bc63b5b74d063 Mon Sep 17 00:00:00 2001 From: Tim Keith Date: Wed, 25 Apr 2018 11:44:12 -0700 Subject: [PATCH] [flang] Remove unnecessary defaults in switches. Original-commit: flang-compiler/f18@f4835e3831f875fb3ae56f390201ab34422c64e3 Reviewed-on: https://github.com/flang-compiler/f18/pull/70 Tree-same-pre-rewrite: false --- flang/lib/semantics/resolve-names.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flang/lib/semantics/resolve-names.cc b/flang/lib/semantics/resolve-names.cc index 70a9926..6f7d787 100644 --- a/flang/lib/semantics/resolve-names.cc +++ b/flang/lib/semantics/resolve-names.cc @@ -95,8 +95,9 @@ protected: switch (x.v) { case parser::AccessSpec::Kind::Public: return Attr::PUBLIC; case parser::AccessSpec::Kind::Private: return Attr::PRIVATE; - default: CRASH_NO_CASE; } + // unnecessary but g++ warns "control reaches end of non-void function" + parser::die("unreachable"); } }; @@ -540,7 +541,6 @@ bool AttrsVisitor::Pre(const parser::IntentSpec &x) { attrs_->set(Attr::INTENT_IN); attrs_->set(Attr::INTENT_OUT); break; - default: CRASH_NO_CASE; } return false; } @@ -775,7 +775,6 @@ bool ImplicitRulesVisitor::HandleImplicitNone( } ++sawType; break; - default: CRASH_NO_CASE; } } if (sawType > 1) { -- 2.7.4