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>
This commit is contained in:
Noel Grandin
2017-06-13 10:27:38 +02:00
parent d6da9e495d
commit 71112060e0
15 changed files with 32 additions and 45 deletions

View File

@@ -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);
}

View File

@@ -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