summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-09 18:20:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-09 23:22:27 +0100
commitcc033ec70ad91180c9d5c8ee081be933973f1f07 (patch)
tree0b61327323ad94a078c710588fa1d53232ee906b /compilerplugins
parentDon't build off-by-default loplugin:unusedfields on Windows for now (diff)
downloadcore-cc033ec70ad91180c9d5c8ee081be933973f1f07.tar.gz
core-cc033ec70ad91180c9d5c8ee081be933973f1f07.zip
Don't use non-Windows sys/time.h
(The comment what the test wants to check quotes noelgrandin on #libreoffice- dev.) Change-Id: I8e8980902c8113eb75d24064e68a47e70bc483d6 Reviewed-on: https://gerrit.libreoffice.org/47676 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/test/passstuffbyref.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/compilerplugins/clang/test/passstuffbyref.cxx b/compilerplugins/clang/test/passstuffbyref.cxx
index f6277b4bbf07..3f0efb1d106e 100644
--- a/compilerplugins/clang/test/passstuffbyref.cxx
+++ b/compilerplugins/clang/test/passstuffbyref.cxx
@@ -8,7 +8,6 @@
*/
#include <rtl/ustring.hxx>
-#include <sys/time.h>
#include <o3tl/cow_wrapper.hxx>
#include <vector>
@@ -57,10 +56,11 @@ struct S2 {
// no warning expected
-timeval &operator -= ( timeval &t1, const timeval &t2 );
-timeval operator-( const timeval &t1, const timeval &t2 )
+// Don't flag stuff where the local var is hidden behind a self-returning operation like -=:
+S2 &operator -= ( S2 &t1, const S2 &t2 );
+S2 operator-( const S2 &t1, const S2 &t2 )
{
- timeval t0 = t1;
+ S2 t0 = t1;
return t0 -= t2;
}