Add -Wsuggest-override (#264)

We also add the suggested `override` keyword.
This commit is contained in:
fiesh 2020-10-21 01:24:41 +02:00 committed by GitHub
parent 12e496da3d
commit 66b52e6cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wshadow -Weffc++ -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wshadow -Weffc++ -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion -Wsuggest-override")
endif()
add_library(cxxopts INTERFACE)

View File

@ -951,7 +951,7 @@ namespace cxxopts
CXXOPTS_NODISCARD
std::shared_ptr<Value>
clone() const
clone() const override
{
return std::make_shared<standard_value<T>>(*this);
}