mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
Fixed warning with enum value in switch statement
This commit is contained in:
parent
ab9a09bb88
commit
51ed96c8f2
@ -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)
|
||||
|
4
peglib.h
4
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");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user