mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
Source: Suppress gcc 15 -Wmaybe-uninitialized in std::function
The warning is in the `std::function` implementation.
This commit is contained in:
@@ -47,10 +47,19 @@ auto const RootVersionHelper = JSONHelperBuilder::Object<TopVersion>().Bind(
|
||||
bool ResourceIdHelper(std::string& out, Json::Value const* value,
|
||||
cmJSONState* state)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC__ >= 15
|
||||
# define CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
if (!JSONHelperBuilder::String(cmCTestResourceSpecErrors::INVALID_RESOURCE)(
|
||||
out, value, state)) {
|
||||
return false;
|
||||
}
|
||||
#ifdef CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
# pragma GCC diagnostic pop
|
||||
# undef CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
#endif
|
||||
cmsys::RegularExpressionMatch match;
|
||||
if (!IdRegex.find(out.c_str(), match)) {
|
||||
cmCTestResourceSpecErrors::INVALID_RESOURCE(value, state);
|
||||
|
||||
@@ -52,6 +52,11 @@ ObjectErrorGenerator INVALID_NAMED_OBJECT(
|
||||
std::function<std::string(Json::Value const*, cmJSONState*)> const&
|
||||
nameGenerator)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC__ >= 15
|
||||
# define CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
return [nameGenerator](
|
||||
ObjectError errorType,
|
||||
Json::Value::Members const& extraFields) -> ErrorGenerator {
|
||||
@@ -85,6 +90,10 @@ ObjectErrorGenerator INVALID_NAMED_OBJECT(
|
||||
}
|
||||
};
|
||||
};
|
||||
#ifdef CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
# pragma GCC diagnostic pop
|
||||
# undef CM_GCC_diagnostic_push_Wmaybe_uninitialized
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorGenerator INVALID_OBJECT(ObjectError errorType,
|
||||
|
||||
Reference in New Issue
Block a user