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"); } } };