summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-10 09:24:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-06-06 14:15:43 +0200
commitd0069e5189f5410e1db7aa395f0754109e872f46 (patch)
tree30c860e8d780c3461c6048be9594f642f03de5de /include
parentcc2db25645ede743bdc3824fe7d26ea4beda6a96 (diff)
add COVERITY_NOEXCEPT_FALSE
to markup dtors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4 Reviewed-on: https://gerrit.libreoffice.org/38318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/com/sun/star/uno/Reference.h2
-rw-r--r--include/com/sun/star/uno/Reference.hxx3
-rw-r--r--include/comphelper/componentbase.hxx2
-rw-r--r--include/cppuhelper/weak.hxx2
-rw-r--r--include/editeng/unoedsrc.hxx2
-rw-r--r--include/osl/thread.hxx2
-rw-r--r--include/rtl/ref.hxx2
-rw-r--r--include/sal/types.h10
-rw-r--r--include/salhelper/simplereferenceobject.hxx2
-rw-r--r--include/svl/SfxBroadcaster.hxx2
-rw-r--r--include/svl/hint.hxx2
-rw-r--r--include/svl/listener.hxx2
-rw-r--r--include/svl/lstner.hxx2
-rw-r--r--include/svl/undo.hxx2
-rw-r--r--include/svx/sdr/contact/objectcontact.hxx2
-rw-r--r--include/tools/ref.hxx5
-rw-r--r--include/vcl/scheduler.hxx2
17 files changed, 29 insertions, 17 deletions
diff --git a/include/com/sun/star/uno/Reference.h b/include/com/sun/star/uno/Reference.h
index ba68c74ae574..c24509a51568 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -290,7 +290,7 @@ public:
/** Destructor: Releases interface if set.
*/
- inline ~Reference();
+ inline ~Reference() COVERITY_NOEXCEPT_FALSE;
/** Default Constructor: Sets null reference.
*/
diff --git a/include/com/sun/star/uno/Reference.hxx b/include/com/sun/star/uno/Reference.hxx
index f197007cb8ff..e99cc15f8941 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -103,9 +103,8 @@ inline interface_type * Reference< interface_type >::iset_throw(
NULL );
}
-
template< class interface_type >
-inline Reference< interface_type >::~Reference()
+inline Reference< interface_type >::~Reference() COVERITY_NOEXCEPT_FALSE
{
if (_pInterface)
_pInterface->release();
diff --git a/include/comphelper/componentbase.hxx b/include/comphelper/componentbase.hxx
index 75f43a9f8812..993b81eeeb73 100644
--- a/include/comphelper/componentbase.hxx
+++ b/include/comphelper/componentbase.hxx
@@ -58,7 +58,7 @@ namespace comphelper
{
}
- ~ComponentBase() {}
+ ~ComponentBase() COVERITY_NOEXCEPT_FALSE {}
/** marks the instance as initialized
diff --git a/include/cppuhelper/weak.hxx b/include/cppuhelper/weak.hxx
index cddd79590592..8c8126e47a54 100644
--- a/include/cppuhelper/weak.hxx
+++ b/include/cppuhelper/weak.hxx
@@ -51,7 +51,7 @@ protected:
Despite the fact that a RuntimeException is allowed to be thrown, you must not throw any
exception upon destruction!
*/
- virtual ~OWeakObject();
+ virtual ~OWeakObject() COVERITY_NOEXCEPT_FALSE;
/** disposes and resets m_pWeakConnectionPoint
@pre
diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx
index 6274ccfd9046..92ab6780977a 100644
--- a/include/editeng/unoedsrc.hxx
+++ b/include/editeng/unoedsrc.hxx
@@ -136,7 +136,7 @@ public:
class EDITENG_DLLPUBLIC SvxTextForwarder
{
public:
- virtual ~SvxTextForwarder();
+ virtual ~SvxTextForwarder() COVERITY_NOEXCEPT_FALSE;
virtual sal_Int32 GetParagraphCount() const = 0;
virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const = 0;
diff --git a/include/osl/thread.hxx b/include/osl/thread.hxx
index 4708ec011386..3adfc83fe295 100644
--- a/include/osl/thread.hxx
+++ b/include/osl/thread.hxx
@@ -62,7 +62,7 @@ public:
Thread(): m_hThread(NULL){}
- virtual ~Thread()
+ virtual ~Thread() COVERITY_NOEXCEPT_FALSE
{
osl_destroyThread( m_hThread);
}
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index e8f624a93d6f..7b80da98218d 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -84,7 +84,7 @@ public:
/** Destructor...
*/
- ~Reference()
+ ~Reference() COVERITY_NOEXCEPT_FALSE
{
if (m_pBody)
m_pBody->release();
diff --git a/include/sal/types.h b/include/sal/types.h
index 9d5f699c9794..52066bf40f7d 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -351,6 +351,16 @@ typedef struct _sal_Sequence
*/
#define SAL_THROW_EXTERN_C() throw ()
+/** To markup destructors that coverity warns might throw exceptions
+ which won't throw in practice, or where std::terminate is
+ an acceptable response if they do
+*/
+#if defined(LIBO_INTERNAL_ONLY) && defined(__COVERITY__)
+# define COVERITY_NOEXCEPT_FALSE noexcept(false)
+#else
+# define COVERITY_NOEXCEPT_FALSE
+#endif
+
#else
#define SAL_THROW_EXTERN_C()
diff --git a/include/salhelper/simplereferenceobject.hxx b/include/salhelper/simplereferenceobject.hxx
index e21797ce91be..6671d92ad3b4 100644
--- a/include/salhelper/simplereferenceobject.hxx
+++ b/include/salhelper/simplereferenceobject.hxx
@@ -89,7 +89,7 @@ public:
static void operator delete(void * pPtr, std::nothrow_t const & rNothrow);
protected:
- virtual ~SimpleReferenceObject();
+ virtual ~SimpleReferenceObject() COVERITY_NOEXCEPT_FALSE;
private:
oslInterlockedCount m_nCount;
diff --git a/include/svl/SfxBroadcaster.hxx b/include/svl/SfxBroadcaster.hxx
index e5fb5e16b96a..bacef8d2d3ce 100644
--- a/include/svl/SfxBroadcaster.hxx
+++ b/include/svl/SfxBroadcaster.hxx
@@ -43,7 +43,7 @@ public:
SfxBroadcaster();
SfxBroadcaster( const SfxBroadcaster &rBC );
- virtual ~SfxBroadcaster();
+ virtual ~SfxBroadcaster() COVERITY_NOEXCEPT_FALSE;
void Broadcast( const SfxHint &rHint );
bool HasListeners() const;
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index f7f0c73e062e..2b9c4131a884 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -119,7 +119,7 @@ private:
public:
SfxHint() : mnId(SfxHintId::NONE) {}
explicit SfxHint( SfxHintId nId ) : mnId(nId) {}
- virtual ~SfxHint();
+ virtual ~SfxHint() COVERITY_NOEXCEPT_FALSE;
SfxHintId GetId() const { return mnId; }
};
diff --git a/include/svl/listener.hxx b/include/svl/listener.hxx
index 8ac8e08e91b3..5f2850ef7f19 100644
--- a/include/svl/listener.hxx
+++ b/include/svl/listener.hxx
@@ -46,7 +46,7 @@ public:
SvtListener();
SvtListener( const SvtListener &r );
- virtual ~SvtListener();
+ virtual ~SvtListener() COVERITY_NOEXCEPT_FALSE;
bool StartListening( SvtBroadcaster& rBroadcaster );
bool EndListening( SvtBroadcaster& rBroadcaster );
diff --git a/include/svl/lstner.hxx b/include/svl/lstner.hxx
index 985ff526b7ee..527a13baa834 100644
--- a/include/svl/lstner.hxx
+++ b/include/svl/lstner.hxx
@@ -37,7 +37,7 @@ public:
SfxListener();
SfxListener( const SfxListener &rCopy );
- virtual ~SfxListener();
+ virtual ~SfxListener() COVERITY_NOEXCEPT_FALSE;
void StartListening( SfxBroadcaster& rBroadcaster, bool bPreventDups = false );
void EndListening( SfxBroadcaster& rBroadcaster, bool bAllDups = false );
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index b3301f6f6166..7791d4a4b333 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -50,7 +50,7 @@ class SVL_DLLPUBLIC SfxUndoAction
{
public:
SfxUndoAction();
- virtual ~SfxUndoAction();
+ virtual ~SfxUndoAction() COVERITY_NOEXCEPT_FALSE;
virtual void Undo();
virtual void UndoWithContext( SfxUndoContext& i_context );
diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx
index 7185aa20132b..4722a4f376e9 100644
--- a/include/svx/sdr/contact/objectcontact.hxx
+++ b/include/svx/sdr/contact/objectcontact.hxx
@@ -93,7 +93,7 @@ protected:
public:
// basic constructor
ObjectContact();
- virtual ~ObjectContact();
+ virtual ~ObjectContact() COVERITY_NOEXCEPT_FALSE;
// LazyInvalidate request. This is used from the VOCs to mark that they
// got invalidated by an ActionChanged() call. An active view needs to remember
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index bb32d486339e..68a1c3f56f09 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -126,7 +126,7 @@ class TOOLS_DLLPUBLIC SvRefBase
unsigned int bNoDelete : 1;
protected:
- virtual ~SvRefBase();
+ virtual ~SvRefBase() COVERITY_NOEXCEPT_FALSE;
public:
SvRefBase() : nRefCount(0), bNoDelete(1) {}
@@ -217,6 +217,9 @@ public:
SvCompatWeakRef( ) {}
SvCompatWeakRef( T* pObj )
{ if( pObj ) _xHdl = pObj->GetHdl(); }
+#if defined(__COVERITY__)
+ ~SvCompatWeakRef() COVERITY_NOEXCEPT_FALSE {}
+#endif
SvCompatWeakRef& operator = ( T * pObj )
{ _xHdl = pObj ? pObj->GetHdl() : nullptr; return *this; }
bool is() const
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index a34c7c14f9ab..86c6c5bead01 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -104,7 +104,7 @@ protected:
public:
Task( const sal_Char *pDebugName );
Task( const Task& rTask );
- virtual ~Task();
+ virtual ~Task() COVERITY_NOEXCEPT_FALSE;
Task& operator=( const Task& rTask );
void SetPriority(TaskPriority ePriority) { mePriority = ePriority; }