diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-16 17:55:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-16 17:55:15 +0200 |
commit | 43d633d789d817916a11801d0bd3c927a75ac258 (patch) | |
tree | f86cbe9221f33309aeb0ebf261145edcaab1563c /include/o3tl | |
parent | sd draw text: emit LOK_CALLBACK_VIEW_LOCK from registerCallback() (diff) | |
download | core-43d633d789d817916a11801d0bd3c927a75ac258.tar.gz core-43d633d789d817916a11801d0bd3c927a75ac258.zip |
Try silence cid#1371124 ("Operands don't affect result")
...where Coverity doesn't reveal which instantiation of the templated code it is
complaining about, but it must be ScRefFlags (sc/inc/address.hxx), which has
underlying type sal_uInt16 and a mask of 0xFFFF.
Change-Id: If0abd195885acdffb3c61cdab88d7a2c87c00c4f
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/typed_flags_set.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx index 9b8cb817ee02..e3ca014abfca 100644 --- a/include/o3tl/typed_flags_set.hxx +++ b/include/o3tl/typed_flags_set.hxx @@ -79,7 +79,11 @@ struct is_typed_flags { { #if !HAVE_CXX11_CONSTEXPR || HAVE_CXX14_CONSTEXPR assert(detail::isNonNegative(value)); - assert((value & ~M) == 0); + assert( + static_cast<typename std::underlying_type<E>::type>(~M) == 0 + // avoid "operands don't affect result" warnings when M + // covers all bits of the underlying type + || (value & ~M) == 0); #endif } |