diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-03 14:35:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-03 14:35:38 +0100 |
commit | 803f4743372aa51be123533115afa97a47336d54 (patch) | |
tree | a6f263ce7ba841d72838a31ec2e51126b6a4d777 /include | |
parent | f82cd9c786933a641ab131758a9fc1bd291824cc (diff) |
Mark [Scoped]VclPtrInstance as SAL_WARN_UNUSED
Stack-allocated instances of the non-Instance [Scoped]VclPtr variants are
occasionally used merely for the side-effect of holding objects alive (like
css::uno::Reference and rtl::Reference, which are also not SAL_WARN_UNUSED for
that reason).
Change-Id: I37ebfaf028a646cb2777c0baf0d99992057a22bd
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/vclptr.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 31f97dc50602..39e4fe918d52 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -295,7 +295,7 @@ template<typename T> inline bool operator !=(T * p1, VclPtr<T> const & p2) { * @param reference_type must be a subclass of vcl::Window */ template <class reference_type> -class VclPtrInstance : public VclPtr<reference_type> +class SAL_WARN_UNUSED VclPtrInstance : public VclPtr<reference_type> { public: template<typename... Arg> VclPtrInstance(Arg &&... arg) @@ -407,7 +407,7 @@ protected: #pragma warning(disable: 4521) // " multiple copy constructors specified" #endif template <class reference_type> -class ScopedVclPtrInstance : public ScopedVclPtr<reference_type> +class SAL_WARN_UNUSED ScopedVclPtrInstance : public ScopedVclPtr<reference_type> { public: template<typename... Arg> ScopedVclPtrInstance(Arg &&... arg) |