2 Commits

Author SHA1 Message Date
Jean-Louis Leroy
55b8c07a57 disable incorrect coverity warnings 2026-01-20 16:50:17 -05:00
Jean-Louis Leroy
6fdbfb361a reformat 2026-01-20 16:50:17 -05:00
3 changed files with 9 additions and 8 deletions

View File

@@ -70,8 +70,8 @@ struct va_args<ReturnType> {
ForwarderParameters...>::type \
BOOST_OPENMETHOD_GUIDE(NAME)(ForwarderParameters && ... args); \
template<typename... ForwarderParameters> \
inline auto NAME(ForwarderParameters&&... args) \
->typename ::boost::openmethod::detail::enable_forwarder< \
inline auto NAME(ForwarderParameters&&... args) -> \
typename ::boost::openmethod::detail::enable_forwarder< \
void, BOOST_OPENMETHOD_TYPE(NAME, ARGS, __VA_ARGS__), \
::boost::openmethod::detail::va_args<__VA_ARGS__>::return_type, \
ForwarderParameters...>::type { \
@@ -102,15 +102,13 @@ struct va_args<ReturnType> {
static auto next(Args&&... args) -> decltype(auto); \
}; \
inline auto BOOST_OPENMETHOD_OVERRIDERS( \
NAME)<__VA_ARGS__ ARGS>::has_next() \
->bool { \
NAME)<__VA_ARGS__ ARGS>::has_next() -> bool { \
return boost_openmethod_detail_locate_method_aux< \
void ARGS>::type::has_next<fn>(); \
} \
template<typename... Args> \
inline auto BOOST_OPENMETHOD_OVERRIDERS(NAME)<__VA_ARGS__ ARGS>::next( \
Args&&... args) \
->decltype(auto) { \
Args&&... args) -> decltype(auto) { \
return boost_openmethod_detail_locate_method_aux< \
void ARGS>::type::next<fn>(std::forward<Args>(args)...); \
}
@@ -125,7 +123,7 @@ struct va_args<ReturnType> {
#define BOOST_OPENMETHOD_DEFINE_OVERRIDER(NAME, ARGS, ...) \
BOOST_OPENMETHOD_DETAIL_REGISTER_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
auto BOOST_OPENMETHOD_OVERRIDER(NAME, ARGS, __VA_ARGS__)::fn ARGS \
->boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
-> boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
#define BOOST_OPENMETHOD_OVERRIDE(NAME, ARGS, ...) \
BOOST_OPENMETHOD_DECLARE_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
@@ -135,7 +133,7 @@ struct va_args<ReturnType> {
BOOST_OPENMETHOD_DECLARE_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
BOOST_OPENMETHOD_DETAIL_REGISTER_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
inline auto BOOST_OPENMETHOD_OVERRIDER(NAME, ARGS, __VA_ARGS__)::fn ARGS \
->boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
-> boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
#define BOOST_OPENMETHOD_CLASSES(...) \
BOOST_OPENMETHOD_REGISTER(::boost::openmethod::use_classes<__VA_ARGS__>)

View File

@@ -116,6 +116,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
unique_virtual_ptr<Dog, Registry> p(std::make_unique<Dog>());
auto dog = p.get();
unique_virtual_ptr<Dog, Registry> q(std::move(p));
// coverity[use_after_move]
BOOST_TEST(q.get() == dog);
BOOST_TEST(q.vptr() == Registry::template static_vptr<Dog>);
BOOST_TEST(p.get() == nullptr);
@@ -127,6 +128,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
unique_virtual_ptr<Dog, Registry> p(std::make_unique<Dog>());
auto dog = p.get();
unique_virtual_ptr<Animal, Registry> q(std::move(p));
// coverity[use_after_move]
BOOST_TEST(q.get() == dog);
BOOST_TEST(q.vptr() == Registry::template static_vptr<Dog>);
BOOST_TEST(p.get() == nullptr);

View File

@@ -168,6 +168,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(
Dog snoopy;
virtual_ptr<Dog, Registry> p(snoopy);
virtual_ptr<Dog, Registry> q(std::move(p));
// coverity[use_after_move]
BOOST_TEST(q.get() == &snoopy);
BOOST_TEST(q.vptr() == Registry::template static_vptr<Dog>);
BOOST_TEST(p.get() == &snoopy);