Make implicit-fallthrough a compilation error
This commit is contained in:
parent
c647134916
commit
c4327cfb00
@ -182,7 +182,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||||||
# c99-designator is disabled because of required mixture of designated and
|
# c99-designator is disabled because of required mixture of designated and
|
||||||
# non-designated initializers in Python Query Module code (`py_module.cpp`).
|
# non-designated initializers in Python Query Module code (`py_module.cpp`).
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall \
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall \
|
||||||
-Werror=switch -Werror=switch-bool -Werror=return-type \
|
-Werror=switch -Werror=switch-bool -Werror=implicit-fallthrough \
|
||||||
|
-Werror=return-type \
|
||||||
-Werror=return-stack-address \
|
-Werror=return-stack-address \
|
||||||
-Wno-c99-designator \
|
-Wno-c99-designator \
|
||||||
-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT")
|
-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT")
|
||||||
|
@ -74,7 +74,7 @@ State RunHandlerV4(Signature signature, TSession &session, State state, Marker m
|
|||||||
}
|
}
|
||||||
case Signature::Route: {
|
case Signature::Route: {
|
||||||
if constexpr (bolt_minor >= 3) {
|
if constexpr (bolt_minor >= 3) {
|
||||||
if (signature == Signature::Route) return HandleRoute<TSession>(session);
|
return HandleRoute<TSession>(session);
|
||||||
} else {
|
} else {
|
||||||
spdlog::trace("Supported only in bolt v4.3");
|
spdlog::trace("Supported only in bolt v4.3");
|
||||||
return State::Close;
|
return State::Close;
|
||||||
|
@ -97,15 +97,15 @@ bool LastCommittedVersionHasLabelProperty(const Vertex &vertex, LabelId label, c
|
|||||||
if (delta->label == label) {
|
if (delta->label == label) {
|
||||||
MG_ASSERT(!has_label, "Invalid database state!");
|
MG_ASSERT(!has_label, "Invalid database state!");
|
||||||
has_label = true;
|
has_label = true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case Delta::Action::REMOVE_LABEL: {
|
case Delta::Action::REMOVE_LABEL: {
|
||||||
if (delta->label == label) {
|
if (delta->label == label) {
|
||||||
MG_ASSERT(has_label, "Invalid database state!");
|
MG_ASSERT(has_label, "Invalid database state!");
|
||||||
has_label = false;
|
has_label = false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case Delta::Action::ADD_IN_EDGE:
|
case Delta::Action::ADD_IN_EDGE:
|
||||||
case Delta::Action::ADD_OUT_EDGE:
|
case Delta::Action::ADD_OUT_EDGE:
|
||||||
|
@ -471,12 +471,14 @@ std::array<std::vector<EdgeAccessor>, 2> GetEdgesFromVertex(const VertexAccessor
|
|||||||
if (edges.HasValue()) {
|
if (edges.HasValue()) {
|
||||||
in_edges = edges.GetValue();
|
in_edges = edges.GetValue();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case memgraph::msgs::EdgeDirection::OUT: {
|
case memgraph::msgs::EdgeDirection::OUT: {
|
||||||
auto edges = vertex_accessor.OutEdges(View::OLD);
|
auto edges = vertex_accessor.OutEdges(View::OLD);
|
||||||
if (edges.HasValue()) {
|
if (edges.HasValue()) {
|
||||||
out_edges = edges.GetValue();
|
out_edges = edges.GetValue();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case memgraph::msgs::EdgeDirection::BOTH: {
|
case memgraph::msgs::EdgeDirection::BOTH: {
|
||||||
auto maybe_in_edges = vertex_accessor.InEdges(View::OLD);
|
auto maybe_in_edges = vertex_accessor.InEdges(View::OLD);
|
||||||
@ -488,6 +490,7 @@ std::array<std::vector<EdgeAccessor>, 2> GetEdgesFromVertex(const VertexAccessor
|
|||||||
if (maybe_out_edges.HasValue()) {
|
if (maybe_out_edges.HasValue()) {
|
||||||
out_edges = maybe_out_edges.GetValue();
|
out_edges = maybe_out_edges.GetValue();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user