diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-13 10:27:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-29 08:18:35 +0200 |
commit | 71112060e0930fc58087c3762e836b1e12b60f75 (patch) | |
tree | 3bd54aa5b5864d9cd31d0aa3ec4080b46cf66a2d /compilerplugins | |
parent | d6da9e495d7ca32de6cda1a94cb4c8cd26b240cc (diff) |
loplugin:oncevar various
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6
Reviewed-on: https://gerrit.libreoffice.org/38766
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/oncevar.cxx | 6 | ||||
-rw-r--r-- | compilerplugins/clang/test/oncevar.cxx | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/compilerplugins/clang/oncevar.cxx b/compilerplugins/clang/oncevar.cxx index 9d03512012c1..1fa6cd53acf0 100644 --- a/compilerplugins/clang/oncevar.cxx +++ b/compilerplugins/clang/oncevar.cxx @@ -63,6 +63,10 @@ public: // TODO taking local reference to variable if (fn == SRCDIR "/sc/source/filter/excel/xechart.cxx") return; + // macros managing to generate to a valid warning + if (fn == SRCDIR "/solenv/bin/concat-deps.c") + return; + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); for (auto const & varDecl : maVarDeclSet) @@ -272,7 +276,7 @@ bool OnceVar::VisitDeclRefExpr( const DeclRefExpr* declRefExpr ) return true; } -loplugin::Plugin::Registration< OnceVar > X("oncevar", false); +loplugin::Plugin::Registration< OnceVar > X("oncevar", true); } diff --git a/compilerplugins/clang/test/oncevar.cxx b/compilerplugins/clang/test/oncevar.cxx index 214293f185e5..32ff42d4479d 100644 --- a/compilerplugins/clang/test/oncevar.cxx +++ b/compilerplugins/clang/test/oncevar.cxx @@ -11,12 +11,12 @@ /*int foo() { return 1; }*/ -void call_value(int); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} -void call_const_ref(int const &); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} -void call_ref(int &); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} -void call_value(OUString); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} -void call_const_ref(OUString const &); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} -void call_ref(OUString &); // expected-error {{extern prototype in main file without definition [loplugin:externandnotdefined]}} +void call_value(int); +void call_const_ref(int const &); +void call_ref(int &); +void call_value(OUString); +void call_const_ref(OUString const &); +void call_ref(OUString &); int main() { /* TODO |