summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-30 11:26:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-10-30 20:22:54 +0100
commitc9858b725bdb0fe459d89e0d2aa9c7e391989cba (patch)
tree3603836a33148807da846afc456bc23c9225ecf1 /compilerplugins
parent2cd4378177621e82e1b0128b6558f7d69ae9fdb8 (diff)
Clarify current loplugin:stringadd behavior
Change-Id: Ie5fb84e2b9afddcf86c86364811f0c4f5b90c82e Reviewed-on: https://gerrit.libreoffice.org/81748 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/test/stringadd.cxx11
1 files changed, 11 insertions, 0 deletions
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@+1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}}
aFirstStr += "...";
}
+void f4(int i)
+{
+ OUString s("xxx");
+ // expected-error@+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@+1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}}
+ s += "xxx";
+}
}
namespace test2