Fixed warning with enum value in switch statement

This commit is contained in:
yhirose 2020-04-18 21:12:55 -04:00
parent ab9a09bb88
commit 51ed96c8f2
2 changed files with 2 additions and 4 deletions

View File

@ -23,7 +23,7 @@ endif()
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") 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") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra")
elseif(MSVC) elseif(MSVC)

View File

@ -3136,10 +3136,8 @@ private:
case Loop::Type::opt: return opt(ope); case Loop::Type::opt: return opt(ope);
case Loop::Type::zom: return zom(ope); case Loop::Type::zom: return zom(ope);
case Loop::Type::oom: return oom(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); return rep(ope, loop.range.first, loop.range.second);
default:
throw std::runtime_error("Unhandled enum constant");
} }
} }
}; };