-Werror,-Wrange-loop-analysis

Change-Id: I254e1b69f66b985d66c9ce3707614c3b505f2335
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101975
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2020-09-02 21:09:29 +02:00
parent 3577292de9
commit 8dcb43b430
4 changed files with 7 additions and 7 deletions

View File

@ -46,7 +46,7 @@ bool isDerivedFrom(
bool * hidden)
{
bool derived = false;
for (auto const i: decl->bases()) {
for (auto const & i: decl->bases()) {
auto const bd
= (cast<CXXRecordDecl>(i.getType()->getAs<RecordType>()->getDecl())
->getDefinition());

View File

@ -421,7 +421,7 @@ private:
{
continue;
}
for (auto const t : affected)
for (auto const& t : affected)
{
auto const tc = t.getCanonicalType();
for (auto p = f->param_begin(); p != f->param_end(); ++p)

View File

@ -235,7 +235,7 @@ private:
void FakeBool::run() {
if (compiler.getLangOpts().CPlusPlus) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
for (auto const dcl: varDecls_) {
for (auto const & dcl: varDecls_) {
auto const decl = dcl.first; auto const fbk = dcl.second;
SourceLocation loc { compat::getBeginLoc(decl) };
TypeSourceInfo * tsi = decl->getTypeSourceInfo();
@ -277,7 +277,7 @@ void FakeBool::run() {
<< decl->getSourceRange();
}
}
for (auto const dcl: fieldDecls_) {
for (auto const & dcl: fieldDecls_) {
auto const decl = dcl.first; auto const fbk = dcl.second;
SourceLocation loc { compat::getBeginLoc(decl) };
TypeSourceInfo * tsi = decl->getTypeSourceInfo();
@ -319,7 +319,7 @@ void FakeBool::run() {
}
}
auto const ignoredFns = getFunctionsWithAddressTaken();
for (auto const dcl: parmVarDecls_) {
for (auto const & dcl: parmVarDecls_) {
auto const decl = dcl.first; auto const fbk = dcl.second;
FunctionDecl const * f = cast<FunctionDecl>(decl->getDeclContext())->getCanonicalDecl();
if (ignoredFns.find(f) != ignoredFns.end()) {
@ -393,7 +393,7 @@ void FakeBool::run() {
<< decl->getSourceRange();
}
}
for (auto const dcl: functionDecls_) {
for (auto const & dcl: functionDecls_) {
auto const decl = dcl.first; auto const fbk = dcl.second;
FunctionDecl const * f = decl->getCanonicalDecl();
if (ignoredFns.find(f) != ignoredFns.end()) {

View File

@ -609,7 +609,7 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation
}
ranges.emplace_back(startLoc, endLoc);
for (auto const range : ranges)
for (auto const& range : ranges)
{
if (range.isInvalid())
{