From 51ed96c8f291956ea73766afff8813f8c4496e87 Mon Sep 17 00:00:00 2001 From: yhirose Date: Sat, 18 Apr 2020 21:12:55 -0400 Subject: [PATCH] Fixed warning with enum value in switch statement --- CMakeLists.txt | 2 +- peglib.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca45acf..0e868da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(CMAKE_CXX_EXTENSIONS OFF) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-padded -Wno-weak-vtables -Wno-exit-time-destructors -Wno-c++2a-compat") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-padded -Wno-weak-vtables -Wno-exit-time-destructors -Wno-c++2a-compat -Wno-switch-enum") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra") elseif(MSVC) diff --git a/peglib.h b/peglib.h index d59f974..6b7e693 100644 --- a/peglib.h +++ b/peglib.h @@ -3136,10 +3136,8 @@ private: case Loop::Type::opt: return opt(ope); case Loop::Type::zom: return zom(ope); case Loop::Type::oom: return oom(ope); - case Loop::Type::rep: // Regex-like repetition + default: // Regex-like repetition return rep(ope, loop.range.first, loop.range.second); - default: - throw std::runtime_error("Unhandled enum constant"); } } };