diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-10-30 11:26:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-30 20:22:54 +0100 |
commit | c9858b725bdb0fe459d89e0d2aa9c7e391989cba (patch) | |
tree | 3603836a33148807da846afc456bc23c9225ecf1 /compilerplugins | |
parent | 2cd4378177621e82e1b0128b6558f7d69ae9fdb8 (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.cxx | 11 |
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 |