Fixed warning with enum value in switch statement

pull/100/head
yhirose 4 years ago
parent ab9a09bb88
commit 51ed96c8f2
  1. 2
      CMakeLists.txt
  2. 4
      peglib.h

@ -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)

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

Loading…
Cancel
Save