diff --git a/cfg/boost.cfg b/cfg/boost.cfg
index 245945e18a3..fc6836da757 100644
--- a/cfg/boost.cfg
+++ b/cfg/boost.cfg
@@ -1267,4 +1267,17 @@
+
+
+ boost::lock_guard
+ boost::mutex::scoped_lock
+ boost::recursive_mutex::scoped_lock
+ boost::unique_lock
+ boost::shared_lock
+
+
+ boost::mutex
+ boost::recursive_mutex
+
+
diff --git a/test/cfg/boost.cpp b/test/cfg/boost.cpp
index b59813bc67f..d2e19fbd2b1 100644
--- a/test/cfg/boost.cpp
+++ b/test/cfg/boost.cpp
@@ -13,6 +13,8 @@
#include
#include
#include
+#include
+#include
BOOST_FORCEINLINE void boost_forceinline_test()
{}
@@ -94,4 +96,10 @@ void containerOutOfBounds_scoped_array(std::size_t n) // #12356
boost::scoped_array d(new int[n] {});
for (std::size_t i = 0; i < n; i++)
if (d[i]) {}
+}
+
+void lock_guard_finiteLifetime(boost::mutex& m)
+{
+ // cppcheck-suppress unusedScopedObject
+ boost::lock_guard{ m };
}
\ No newline at end of file