summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang')
-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