compilerplugins/clang/test/unreffun.cxx |   16 ++++++++++++++++
 compilerplugins/clang/test/unreffun.hxx |    2 ++
 2 files changed, 18 insertions(+)

New commits:
commit 53ad80f72fb1067b975be5ff597f869f05ac97f6
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Mar 2 00:11:40 2023 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Mar 2 07:10:19 2023 +0000

    Record loplugin:unreffun false positive caused by a Clang bug
    
    (see the comments at
    
<https://gerrit.libreoffice.org/c/core/+/146634/7#message-5164bcbdb4efa4711f001ce05b670b592392d853>
    "test: Use css::awt::XExtentdedToolkit::addTopWindowListener()" for how this
    caused an issue in the wild)
    
    Change-Id: Id5ec77885db45d039aedc7e13d714aaa96572e91
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148076
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/compilerplugins/clang/test/unreffun.cxx 
b/compilerplugins/clang/test/unreffun.cxx
index b61171a87c84..fc202b80f378 100644
--- a/compilerplugins/clang/test/unreffun.cxx
+++ b/compilerplugins/clang/test/unreffun.cxx
@@ -36,4 +36,20 @@ void l() // expected-error {{Unreferenced externally visible 
function definition
 {
 }
 
+void m()
+{
+//TODO: The below would produce a false "Unreferenced externally invisible 
function definition" for
+// Local::f due to the Clang bug addressed at 
<https://reviews.llvm.org/D145123> "Call
+// MarkVirtualMembersReferenced on an actual class definition":
+#if 0
+    struct Local;
+#endif
+    struct Local
+    {
+        virtual void f() {}
+    };
+    Local x;
+    (void)x;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/compilerplugins/clang/test/unreffun.hxx 
b/compilerplugins/clang/test/unreffun.hxx
index a209dd7b6437..7eea5233fde7 100644
--- a/compilerplugins/clang/test/unreffun.hxx
+++ b/compilerplugins/clang/test/unreffun.hxx
@@ -13,4 +13,6 @@ void f();
 
 extern void i();
 
+void m();
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to