compilerplugins/clang/stringconcatauto.cxx      |    4 ----
 compilerplugins/clang/test/stringconcatauto.cxx |    9 +--------
 2 files changed, 1 insertion(+), 12 deletions(-)

New commits:
commit 2ed901c1d9ca86f829b56581ce33beaacc38a6b5
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Sat Nov 5 11:34:34 2022 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Dec 20 12:44:47 2022 +0000

    loplugin:stringconcatauto: There's no dangling-ref issue with 
O[U]StringNumber
    
    ...so it's unclear why 2f5f45921b05904a4be1ff633be09c62cb44ff08 "support
    O(U)String::number() for fast string concatenation" added that here.
    
    On the contrary, variables of type OStringNumber can be useful replacements 
for
    calls to std::sprintf (which started to emit deprecation warnings with
    macOS 13 SDK now), so this is in preparation for follow-up commits that will
    replace many uses of that across the code base with various alternatives.
    
    Change-Id: I6f8508d49dc84773c50f4c33dba38fe08c4c8969
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142318
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144585

diff --git a/compilerplugins/clang/stringconcatauto.cxx 
b/compilerplugins/clang/stringconcatauto.cxx
index 561aedec8070..1ff3f41d3cf8 100644
--- a/compilerplugins/clang/stringconcatauto.cxx
+++ b/compilerplugins/clang/stringconcatauto.cxx
@@ -87,10 +87,6 @@ bool StringConcatAuto::checkDecl( const DeclaratorDecl* 
decl, QualType type, con
         typeString = "OUString";
     else if( tc.Struct("OStringConcat").Namespace("rtl").GlobalNamespace())
         typeString = "OString";
-    else if( tc.Struct("OUStringNumber").Namespace("rtl").GlobalNamespace())
-        typeString = "OUString";
-    else if( tc.Struct("OStringNumber").Namespace("rtl").GlobalNamespace())
-        typeString = "OString";
     else
         return true;
     report( DiagnosticsEngine::Warning,
diff --git a/compilerplugins/clang/test/stringconcatauto.cxx 
b/compilerplugins/clang/test/stringconcatauto.cxx
index dc450503d25e..678d12dd6be4 100644
--- a/compilerplugins/clang/test/stringconcatauto.cxx
+++ b/compilerplugins/clang/test/stringconcatauto.cxx
@@ -24,8 +24,6 @@ void foo()
     // expected-error-re@-1 {{creating a variable of type {{.+}} will make it 
reference temporaries}}
     // expected-note@-2 {{use OString 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}}
     (void)str1;
     (void)str2;
     (void)str3;
@@ -41,12 +39,7 @@ struct A
     {
         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); }
 };
 
 template <typename T> void fun(const T& par)

Reply via email to