-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
Description
I got modernize-return-braced-init-list
warning for next code:
#include <boost/python/extract.hpp>
#include <boost/python/object.hpp>
std::string test(const boost::python::object& data_set, const char* attr)
{
const boost::python::object attribute_object = data_set.attr(attr);
if (attribute_object.is_none())
{
return {};
}
else
{
return boost::python::extract<std::string>(attribute_object);
}
}
warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list]
return boost::python::extract<std::string>(attribute_object);
I tried 19.1 and ~ month-old main
. Boost version is 1.86. Sorry, was not able to reproduce in on GodBolt, because it's not obvious how to specify path to local Boost libraries.
I think will be good idea to have option to filter out such complex type casts in modernize-return-braced-init-list
.