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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 30 19:24:54 UTC 2019


 compilerplugins/clang/test/stringadd.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit c9858b725bdb0fe459d89e0d2aa9c7e391989cba
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 30 11:26:16 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Oct 30 20:22:54 2019 +0100

    Clarify current loplugin:stringadd behavior
    
    Change-Id: Ie5fb84e2b9afddcf86c86364811f0c4f5b90c82e
    Reviewed-on: https://gerrit.libreoffice.org/81748
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/test/stringadd.cxx b/compilerplugins/clang/test/stringadd.cxx
index f36bbbca999e..00582f2db459 100644
--- a/compilerplugins/clang/test/stringadd.cxx
+++ b/compilerplugins/clang/test/stringadd.cxx
@@ -65,6 +65,17 @@ void f3(OUString aStr, int nFirstContent)
     // expected-error at +1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}}
     aFirstStr += "...";
 }
+void f4(int i)
+{
+    OUString s("xxx");
+    // expected-error at +1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}}
+    s += "xxx";
+    ++i;
+    // any other kind of statement breaks the chain (at least for now)
+    s += "xxx";
+    // expected-error at +1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}}
+    s += "xxx";
+}
 }
 
 namespace test2


More information about the Libreoffice-commits mailing list