🚨 fix warnings
This commit is contained in:
parent
35b5de2a29
commit
77f24509d4
@ -51,12 +51,10 @@ set(CLANG_CXXFLAGS "-std=c++11 \
|
||||
-Weverything \
|
||||
-Wno-c++98-compat \
|
||||
-Wno-c++98-compat-pedantic \
|
||||
-Wno-c++2a-compat \
|
||||
-Wno-deprecated-declarations \
|
||||
-Wno-documentation-unknown-command \
|
||||
-Wno-exit-time-destructors \
|
||||
-Wno-float-equal \
|
||||
-Wno-missing-prototypes \
|
||||
-Wno-extra-semi-stmt \
|
||||
-Wno-padded \
|
||||
-Wno-range-loop-analysis \
|
||||
-Wno-switch-enum -Wno-covered-switch-default \
|
||||
@ -193,7 +191,7 @@ set(GCC_CXXFLAGS "-std=c++11 \
|
||||
-Wmismatched-tags \
|
||||
-Wmissing-attributes \
|
||||
-Wmissing-braces \
|
||||
-Wno-missing-declarations \
|
||||
-Wmissing-declarations \
|
||||
-Wmissing-field-initializers \
|
||||
-Wmissing-include-dirs \
|
||||
-Wmissing-profile \
|
||||
@ -301,7 +299,7 @@ set(GCC_CXXFLAGS "-std=c++11 \
|
||||
-Wunused-const-variable=2 \
|
||||
-Wunused-function \
|
||||
-Wunused-label \
|
||||
-Wno-unused-local-typedefs \
|
||||
-Wunused-local-typedefs \
|
||||
-Wunused-macros \
|
||||
-Wunused-parameter \
|
||||
-Wunused-result \
|
||||
|
||||
@ -94,12 +94,14 @@ struct Data
|
||||
std::string b {};
|
||||
};
|
||||
|
||||
void from_json(const json& j, Data& data);
|
||||
void from_json(const json& j, Data& data)
|
||||
{
|
||||
j["a"].get_to(data.a);
|
||||
j["b"].get_to(data.b);
|
||||
}
|
||||
|
||||
bool operator==(Data const& lhs, Data const& rhs);
|
||||
bool operator==(Data const& lhs, Data const& rhs)
|
||||
{
|
||||
return lhs.a == rhs.a && lhs.b == rhs.b;
|
||||
|
||||
@ -199,7 +199,7 @@ template <typename BasicJsonType>
|
||||
static void from_json(const BasicJsonType& j, country& c)
|
||||
{
|
||||
const auto str = j.template get<std::string>();
|
||||
static const std::map<std::string, country> m =
|
||||
const std::map<std::string, country> m =
|
||||
{
|
||||
{"中华人民共和国", country::china},
|
||||
{"France", country::france},
|
||||
|
||||
@ -131,6 +131,13 @@ TEST_CASE("Custom iterator")
|
||||
const char* ptr;
|
||||
};
|
||||
|
||||
// avoid -Wunused-local-typedefs
|
||||
CHECK(std::is_same<MyIterator::difference_type, std::size_t>::value);
|
||||
CHECK(std::is_same<MyIterator::value_type, char>::value);
|
||||
CHECK(std::is_same<MyIterator::pointer, const char*>::value);
|
||||
CHECK(std::is_same<MyIterator::reference, const char&>::value);
|
||||
CHECK(std::is_same<MyIterator::iterator_category, std::input_iterator_tag>::value);
|
||||
|
||||
MyIterator begin{raw_data};
|
||||
MyIterator end{raw_data + strlen(raw_data)};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user