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 -#include #include #include @@ -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; }