summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/test/stringconcatauto.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/test/stringconcatauto.cxx')
-rw-r--r--compilerplugins/clang/test/stringconcatauto.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/compilerplugins/clang/test/stringconcatauto.cxx b/compilerplugins/clang/test/stringconcatauto.cxx
index dc450503d25e..dde4211eaee4 100644
--- a/compilerplugins/clang/test/stringconcatauto.cxx
+++ b/compilerplugins/clang/test/stringconcatauto.cxx
@@ -15,46 +15,42 @@ void foo()
{
auto str1 = "str1" + OUString::number(10);
// expected-error-re@-1 {{creating a variable of type {{.+}} will make it reference temporaries}}
- // expected-note@-2 {{use OUString instead}}
+ // expected-note@-2 {{use O(U)String instead}}
OUString str2 = "str2" + OUString::number(20) + "ing";
const auto& str3 = "str3" + OUString::number(30);
// expected-error-re@-1 {{creating a variable of type {{.+}} will make it reference temporaries}}
- // expected-note@-2 {{use OUString instead}}
+ // expected-note@-2 {{use O(U)String instead}}
const auto str4 = "str4" + OString::number(40);
// expected-error-re@-1 {{creating a variable of type {{.+}} will make it reference temporaries}}
- // expected-note@-2 {{use OString instead}}
+ // expected-note@-2 {{use O(U)String instead}}
auto str5 = OUString::number(50);
- // expected-error-re@-1 {{creating a variable of type '{{(rtl::)?}}OUStringNumber<{{.*}}>' will make it reference temporaries}}
- // expected-note@-2 {{use OUString instead}}
+ auto str6 = OUString::number(50).toAsciiUpperCase();
(void)str1;
(void)str2;
(void)str3;
(void)str4;
(void)str5;
+ (void)str6;
}
struct A
{
auto bar()
// expected-error-re@-1 {{returning a variable of type {{.+}} will make it reference temporaries}}
- // expected-note@-2 {{use OString instead}}
+ // expected-note@-2 {{use O(U)String instead}}
{
return "bar" + OString::number(110);
}
- auto baz()
- // expected-error-re@-1 {{returning a variable of type '{{(rtl::)?}}OStringNumber<{{.*}}>' will make it reference temporaries}}
- // expected-note@-2 {{use OString instead}}
- {
- return OString::number(120);
- }
+ auto baz() { return OString::number(120); }
+ auto baz2() { return OString::number(120).toAsciiUpperCase(); }
};
template <typename T> void fun(const T& par)
// parameters are without warnings
{
const T& var = par;
- // expected-error-re@-1 {{creating a variable of type 'const rtl::OUStringConcat<{{.*}}> &' will make it reference temporaries}}
- // expected-note@-2 {{use OUString instead}}
+ // expected-error-re@-1 {{creating a variable of type 'const rtl::StringConcat<{{.*}}> &' will make it reference temporaries}}
+ // expected-note@-2 {{use O(U)String instead}}
(void)var;
}