compilerplugins/clang/test/stringadd.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+)
New commits: commit c9858b725bdb0fe459d89e0d2aa9c7e391989cba Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Oct 30 11:26:16 2019 +0100 Commit: Stephan Bergmann <sberg...@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 <sberg...@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@+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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits