// expected-error@+1 {{change type of variable 'literal1' from constant character array ('const char [4]') to OStringLiteral [loplugin:stringliteralvar]}}
charconstliteral1[]="foo";
OStringf1()
{
// expected-note@+1 {{first passed into a 'rtl::OString' constructor here [loplugin:stringliteralvar]}}
returnliteral1;
}
voidf(OUStringconst&);
voidf2()
{
// expected-error@+1 {{change type of variable 'literal' from constant character array ('const char [4]') to OUStringLiteral, and make it static [loplugin:stringliteralvar]}}
charconstliteral[]="foo";
// expected-note@+1 {{first passed into a 'rtl::OUString' constructor here [loplugin:stringliteralvar]}}
f(literal);
}
structS3
{
// expected-error@+1 {{change type of variable 'literal' from constant character array ('const char16_t [4]') to OUStringLiteral [loplugin:stringliteralvar]}}
staticconstexprchar16_tliteral[]=u"foo";
};
voidf3()
{
// expected-note@+1 {{first passed into a 'rtl::OUString' constructor here [loplugin:stringliteralvar]}}
f(S3::literal);
}
std::vector<OUString>f4()
{
// expected-error@+1 {{change type of variable 'literal' from constant character array ('const char16_t [4]') to OUStringLiteral [loplugin:stringliteralvar]}}
staticconstexprchar16_tliteral[]=u"foo";
// expected-note@+1 {{first passed into a 'rtl::OUString' constructor here [loplugin:stringliteralvar]}}
return{literal};
}
voidf5()
{
// expected-error@+1 {{variable 'literal' of type 'const rtl::OUStringLiteral<4>' with automatic storage duration most likely needs to be static [loplugin:stringliteralvar]}}
OUStringLiteralconstliteral=u"foo";
// expected-note@+1 {{first converted to 'rtl::OUString' here [loplugin:stringliteralvar]}}
f(literal);
}
voidf6()
{
// expected-error@+1 {{variable 'literal' of type 'const rtl::OUStringLiteral<4>' with automatic storage duration most likely needs to be static [loplugin:stringliteralvar]}}
constexprOUStringLiteralliteral=u"foo";
// expected-note@+1 {{first converted to 'rtl::OUString' here [loplugin:stringliteralvar]}}
// expected-error@+1 {{variable 'literal' of type 'const rtl::OUStringLiteral<4>' suspiciously used in a sizeof expression [loplugin:stringliteralvar]}}
// expected-error@+1 {{change type of variable 'literal' from constant character array ('const sal_Unicode [3]') to OUStringLiteral [loplugin:stringliteralvar]}}
staticsal_Unicodeconstliteral[]={'f','o','o'};
// expected-note@+1 {{first passed into a 'rtl::OUString' constructor here [loplugin:stringliteralvar]}}
// expected-error@+1 {{change type of variable 'literal' from constant character array ('const sal_Unicode [3]') to OUStringLiteral [loplugin:stringliteralvar]}}
staticsal_Unicodeconstliteral[]={'f','o','o'};
// expected-note@+1 {{first passed into a 'rtl::OUString' constructor here [loplugin:stringliteralvar]}}
// expected-error@+1 {{change type of variable 'sDocumentType' from constant character array ('const char [4]') to OUStringLiteral, and make it static [loplugin:stringliteralvar]}}
constcharsDocumentType[]="foo";
OUStringsStreamType;
switch(nStreamType)
{
case1:
// expected-note@+1 {{first assigned here [loplugin:stringliteralvar]}}