[Libreoffice-commits] core.git: compilerplugins/clang

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Feb 22 12:35:59 UTC 2019


 compilerplugins/clang/test/writeonlyvars.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit b87f3dc3c54b0a070da97406230781c19834e25a
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Feb 22 10:39:55 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Feb 22 13:35:22 2019 +0100

    loplugin:writeonlyvars is no-op on Windows, so don't run its test there
    
    But nevertheless, make sure that the variables m_bar9/10 used in combination
    with css::uno::Any have UNO-compatible type.
    
    Change-Id: I4e9915193386278ace128df94f7722d90b2567f2
    Reviewed-on: https://gerrit.libreoffice.org/68195
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/test/writeonlyvars.cxx b/compilerplugins/clang/test/writeonlyvars.cxx
index 719ad26ea870..740befb6f172 100644
--- a/compilerplugins/clang/test/writeonlyvars.cxx
+++ b/compilerplugins/clang/test/writeonlyvars.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#if defined _WIN32 //TODO, see corresponding TODO in compilerplugins/clang/writeonlyvars.cxx
+// expected-no-diagnostics
+#else
+
 #include <vector>
 #include <ostream>
 #include <com/sun/star/uno/Any.hxx>
@@ -62,14 +66,14 @@ void test()
 
     // check that we don't see reads when calling operator>>=
     // expected-error at +1 {{write m_bar9 [loplugin:writeonlyvars]}}
-    int m_bar9;
+    sal_Int32 m_bar9;
     // expected-error at +1 {{read any [loplugin:writeonlyvars]}}
     css::uno::Any any;
     any >>= m_bar9;
 
     // check that we see don't see writes when calling operator<<=
     // expected-error at +1 {{read m_bar10 [loplugin:writeonlyvars]}}
-    int m_bar10;
+    sal_Int32 m_bar10;
     // expected-error at +2 {{write any2 [loplugin:writeonlyvars]}}
     // expected-error at +1 {{read any2 [loplugin:writeonlyvars]}}
     css::uno::Any any2;
@@ -144,4 +148,6 @@ void ReadOnlyAnalysis4()
     x = m_readonlyCss.getArray()[0];
 };
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list