disable incorrect coverity warnings

This commit is contained in:
Jean-Louis Leroy
2026-01-20 15:53:26 -05:00
parent f4860bbac3
commit 3dfaf30264
4 changed files with 6 additions and 1 deletions

View File

@@ -2746,7 +2746,7 @@ method<Id, ReturnType(Parameters...), Registry>::override_impl<
#endif
// zero-initalized static variable
// coverity[uninit_use:FALSE]
// coverity[uninit_use]
if (overrider_info::method) {
BOOST_ASSERT(overrider_info::method == &fn);
return;

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

@@ -117,6 +117,7 @@ BOOST_AUTO_TEST_CASE(smart_virtual_ptr_examples) {
virtual_ptr<std::shared_ptr<Animal>> p = std::move(snoopy);
// coverity[use_after_move]
BOOST_TEST(p.get() == moving);
BOOST_TEST(p.vptr() == default_registry::static_vptr<Dog>);
BOOST_TEST(snoopy.get() == nullptr);
@@ -126,6 +127,7 @@ BOOST_AUTO_TEST_CASE(smart_virtual_ptr_examples) {
make_shared_virtual<Dog>();
virtual_ptr<std::shared_ptr<Animal>> p = std::move(snoopy);
// coverity[use_after_move]
BOOST_TEST(snoopy.get() != nullptr);
BOOST_TEST(p.get() == snoopy.get());
BOOST_TEST(p.vptr() == default_registry::static_vptr<Dog>);

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);