summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-14 15:17:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-14 16:39:20 +0200
commite49a3970f8bdc47721460ed0dfea38d0b7accbb8 (patch)
tree9fe6b7fe2213184734ead6dde28c3c275e68f47f /compilerplugins
parentJoin the thread only if launch succeeded. (diff)
downloadcore-e49a3970f8bdc47721460ed0dfea38d0b7accbb8.tar.gz
core-e49a3970f8bdc47721460ed0dfea38d0b7accbb8.zip
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@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/test/unreffun.cxx14
-rw-r--r--compilerplugins/clang/test/unreffun.hxx2
2 files changed, 16 insertions, 0 deletions
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: */