diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-14 15:17:44 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-14 16:39:20 +0200 |
commit | e49a3970f8bdc47721460ed0dfea38d0b7accbb8 (patch) | |
tree | 9fe6b7fe2213184734ead6dde28c3c275e68f47f | |
parent | 6b12e4a9be9283951ac234692e79c9e00cd32654 (diff) |
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>
-rw-r--r-- | compilerplugins/clang/test/unreffun.cxx | 14 | ||||
-rw-r--r-- | compilerplugins/clang/test/unreffun.hxx | 2 |
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: */ |