From 6be9f0c659a5f91f50a1ac6afa5fc8c9fffe1ead Mon Sep 17 00:00:00 2001 From: Andrew Hardin Date: Fri, 22 Mar 2019 17:48:00 -0600 Subject: [PATCH] Resolve two switch related warnings on GCC 8 (#255) * Add default case to resolve -Werror=switch-default. * Add missing enumeration values to resolve -Werror=switch-enum. * Fix coverage --- include/CLI/App.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/CLI/App.hpp b/include/CLI/App.hpp index a185b99e..71f7b013 100644 --- a/include/CLI/App.hpp +++ b/include/CLI/App.hpp @@ -2234,6 +2234,12 @@ class App { if(retval && positionals_at_end_) { positional_only = true; } + break; + + // LCOV_EXCL_START + default: + HorribleError("unrecognized classifier (you should not see this!)"); + // LCOV_EXCL_END } return retval; } @@ -2396,6 +2402,9 @@ class App { if(!detail::split_windows_style(current, arg_name, value)) throw HorribleError("windows option parsed but missing! You should not see this"); break; + case detail::Classifier::SUBCOMMAND: + case detail::Classifier::POSITIONAL_MARK: + case detail::Classifier::NONE: default: throw HorribleError("parsing got called with invalid option! You should not see this"); }