diff options
Diffstat (limited to 'compilerplugins/clang/test/stringview.cxx')
-rw-r--r-- | compilerplugins/clang/test/stringview.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/stringview.cxx b/compilerplugins/clang/test/stringview.cxx index c03fbb84cb32..16e294a6eeb7 100644 --- a/compilerplugins/clang/test/stringview.cxx +++ b/compilerplugins/clang/test/stringview.cxx @@ -59,6 +59,20 @@ void f1(OString s1) // expected-error@+1 {{rather than copy, pass with a view using subView() [loplugin:stringview]}} ConstructWithView(s1.copy(1)); } +void f1(OUStringBuffer s1) +{ + // expected-error@+1 {{rather than call toString, pass with a view [loplugin:stringview]}} + call_view(s1.toString()); + // expected-error@+1 {{rather than call toString, pass with a view [loplugin:stringview]}} + ConstructWithView(s1.toString()); +} +void f1(OStringBuffer s1) +{ + // expected-error@+1 {{rather than call toString, pass with a view [loplugin:stringview]}} + call_view(s1.toString()); + // expected-error@+1 {{rather than call toString, pass with a view [loplugin:stringview]}} + ConstructWithView(s1.toString()); +} } namespace test2 |