Set switch statement warnings as errors

Summary:
The warnings lifted to errors should help us track down cases which
haven't been covered in a switch. Obviously, using the default case will
not trigger these errors, so default should only be used when we
actually want to cover more cases.

Reviewers: florijan, dgleich, mferencevic

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D975
This commit is contained in:
Teon Banek 2017-11-10 11:31:19 +01:00
parent f50d87f736
commit de7a788311
2 changed files with 1 additions and 3 deletions

View File

@ -72,7 +72,7 @@ endif()
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# For now, explicitly set -std= flag for C++17.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall -Werror=switch -Werror=switch-bool")
# Don't omit frame pointer in RelWithDebInfo, for additional callchain debug.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO

View File

@ -466,8 +466,6 @@ class LabelPropertyIndex {
return lexicographical_compare(ma.begin(), ma.end(), mb.begin(),
mb.end(), cmp);
}
default:
LOG(FATAL) << "Unimplemented type operator.";
}
}