File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 12671267 <not-uninit/>
12681268 </arg>
12691269 </function>
1270+ <type-checks>
1271+ <unusedvar>
1272+ <checkFiniteLifetime>boost::lock_guard</checkFiniteLifetime>
1273+ <checkFiniteLifetime>boost::mutex::scoped_lock</checkFiniteLifetime>
1274+ <checkFiniteLifetime>boost::recursive_mutex::scoped_lock</checkFiniteLifetime>
1275+ <checkFiniteLifetime>boost::unique_lock</checkFiniteLifetime>
1276+ <checkFiniteLifetime>boost::shared_lock</checkFiniteLifetime>
1277+ </unusedvar>
1278+ <operatorEqVarError>
1279+ <suppress>boost::mutex</suppress>
1280+ <suppress>boost::recursive_mutex</suppress>
1281+ </operatorEqVarError>
1282+ </type-checks>
12701283</def>
Original file line number Diff line number Diff line change 1313#include < boost/bind.hpp>
1414#include < boost/function.hpp>
1515#include < boost/smart_ptr/scoped_array.hpp>
16+ #include < boost/thread/mutex.hpp>
17+ #include < boost/thread/lock_guard.hpp>
1618
1719BOOST_FORCEINLINE void boost_forceinline_test ()
1820{}
@@ -94,4 +96,10 @@ void containerOutOfBounds_scoped_array(std::size_t n) // #12356
9496 boost::scoped_array<int > d (new int [n] {});
9597 for (std::size_t i = 0 ; i < n; i++)
9698 if (d[i]) {}
99+ }
100+
101+ void lock_guard_finiteLifetime (boost::mutex& m)
102+ {
103+ // cppcheck-suppress unusedScopedObject
104+ boost::lock_guard<boost::mutex>{ m };
97105}
You can’t perform that action at this time.
0 commit comments