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
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user