diff --git a/CMakeLists.txt b/CMakeLists.txt index 3741d5b5d..a27da3fb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,7 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Wno-unused-parameter") set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast") if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8) - list(APPEND FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wimplicit-fallthrough") # enable warning + list(APPEND FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wimplicit-fallthrough" "-Werror=unused-private-field") # enable warning endif() if(FLATBUFFERS_LIBCXX_WITH_CLANG) if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Linux") diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 8e7d264ef..d7b6427b4 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -2180,6 +2180,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS { return (size > size_) ? 0 : size; #else // Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work. + (void)upper_bound_; FLATBUFFERS_ASSERT(false); return 0; #endif