summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/passstuffbyref.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-13 09:22:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-13 09:22:13 +0200
commitd150eab88ee26d5c05a6d662a2c13c6adea8ad78 (patch)
treeb65057acf4090f0d1a257f11fe4b019e46fbbd2d /compilerplugins/clang/passstuffbyref.cxx
parente9c14873ecdc3728135aa26f21d6df468ea0b623 (diff)
loplugin:passstuffbyref: For now disable "pass parm by value" warnings
That needs fixing, to check that the parm is not bound to a reference, cf. <https://gerrit.libreoffice.org/#/c/26189/> "coverity#1362680 Pointer to local outside scope". Change-Id: I3656354ccd10affafa006c9e46cf1db608b5b2a7
Diffstat (limited to 'compilerplugins/clang/passstuffbyref.cxx')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index ca2283cbb5e0..2768b8113e95 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -106,6 +106,7 @@ void PassStuffByRef::checkParams(const FunctionDecl * functionDecl) {
const ParmVarDecl * pvDecl = functionDecl->getParamDecl(i);
auto const t = pvDecl->getType();
if (isPrimitiveConstRef(t)) {
+#if 0 //TODO: check that the parm is not bound to a reference
report(
DiagnosticsEngine::Warning,
("passing primitive type param %0 by const &, rather pass by value"),
@@ -118,6 +119,7 @@ void PassStuffByRef::checkParams(const FunctionDecl * functionDecl) {
can->getLocation())
<< can->getSourceRange();
}
+#endif
}
}
}