[Libreoffice-commits] core.git: compilerplugins/clang

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 14:39:47 UTC 2018


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

New commits:
commit e49a3970f8bdc47721460ed0dfea38d0b7accbb8
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Sep 14 15:17:44 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Sep 14 16:39:20 2018 +0200

    Check that loplugin:unreffun warns for explicitly "extern" functions
    
    Change-Id: Ic43f007af4480b358916c2b27796a9b248ea9eb7
    Reviewed-on: https://gerrit.libreoffice.org/60496
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/test/unreffun.cxx b/compilerplugins/clang/test/unreffun.cxx
index d9d56afe3c35..b61171a87c84 100644
--- a/compilerplugins/clang/test/unreffun.cxx
+++ b/compilerplugins/clang/test/unreffun.cxx
@@ -22,4 +22,18 @@ void h() // expected-error {{Unreferenced externally visible function definition
 {
 }
 
+void i() {}
+
+extern void j(); // expected-error {{Unreferenced function declaration [loplugin:unreffun]}}
+
+extern void
+k() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+{
+}
+
+extern void l(); // expected-note {{first declaration is here [loplugin:unreffun]}}
+void l() // expected-error {{Unreferenced externally visible function definition [loplugin:unreffun]}}
+{
+}
+
 /* 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 20d0e50056be..1df26658429d 100644
--- a/compilerplugins/clang/test/unreffun.hxx
+++ b/compilerplugins/clang/test/unreffun.hxx
@@ -12,6 +12,8 @@
 
 void f();
 
+extern void i();
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list