Mark o3tl::heap_ptr as SAL_WARN_UNUSED
...to make it more straightforward to fix blunder as in
a88b2d8418
"Resolves: fdo#81039 crash on adding
new macro library."
Conceivably, instances of heap_ptr could legitimately be created only for ctor/
dtor effect, but then again uses of heap_ptr should arguably be replaced with
std::unique_ptr anyway.
Change-Id: I9c765b8d265f3c26d459ec276e335eeebc8fee91
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/checked_delete.hpp>
|
||||||
|
#include <sal/types.h>
|
||||||
|
|
||||||
namespace o3tl
|
namespace o3tl
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ namespace o3tl
|
|||||||
complain.
|
complain.
|
||||||
*/
|
*/
|
||||||
template <class T, class Deleter = boost::checked_deleter<T> >
|
template <class T, class Deleter = boost::checked_deleter<T> >
|
||||||
class heap_ptr
|
class SAL_WARN_UNUSED heap_ptr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T element_type; /// Provided for generic programming.
|
typedef T element_type; /// Provided for generic programming.
|
||||||
|
@@ -138,6 +138,7 @@ class heap_ptr_test : public CppUnit::TestFixture
|
|||||||
{
|
{
|
||||||
heap_ptr<Help>
|
heap_ptr<Help>
|
||||||
t_raii( new Help(55) );
|
t_raii( new Help(55) );
|
||||||
|
(void)t_raii;
|
||||||
CPPUNIT_ASSERT_MESSAGE("raii1", Help::InstanceCount_() == nHelpCount + 1);
|
CPPUNIT_ASSERT_MESSAGE("raii1", Help::InstanceCount_() == nHelpCount + 1);
|
||||||
}
|
}
|
||||||
CPPUNIT_ASSERT_MESSAGE("raii2", Help::InstanceCount_() == nHelpCount);
|
CPPUNIT_ASSERT_MESSAGE("raii2", Help::InstanceCount_() == nHelpCount);
|
||||||
|
Reference in New Issue
Block a user