summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-02 21:09:29 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-02 23:39:39 +0200
commit8dcb43b430a008817821e8cc7c7a3984f18cc473 (patch)
tree4ee1cb5f763548e29dff956d9455a2449c60aff0 /compilerplugins
parent3577292de9eb751e4e3c2f799ad22b6ee9f04038 (diff)
-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>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/dyncastvisibility.cxx2
-rw-r--r--compilerplugins/clang/external.cxx2
-rw-r--r--compilerplugins/clang/fakebool.cxx8
-rw-r--r--compilerplugins/clang/salcall.cxx2
4 files changed, 7 insertions, 7 deletions
diff --git a/compilerplugins/clang/dyncastvisibility.cxx b/compilerplugins/clang/dyncastvisibility.cxx
index 788506ee2250..3c54f7cf8929 100644
--- a/compilerplugins/clang/dyncastvisibility.cxx
+++ b/compilerplugins/clang/dyncastvisibility.cxx
@@ -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());
diff --git a/compilerplugins/clang/external.cxx b/compilerplugins/clang/external.cxx
index bc75237a15fd..e3bc67f19c46 100644
--- a/compilerplugins/clang/external.cxx
+++ b/compilerplugins/clang/external.cxx
@@ -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)
diff --git a/compilerplugins/clang/fakebool.cxx b/compilerplugins/clang/fakebool.cxx
index 804f1d51afa1..277dd915bf0d 100644
--- a/compilerplugins/clang/fakebool.cxx
+++ b/compilerplugins/clang/fakebool.cxx
@@ -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()) {
diff --git a/compilerplugins/clang/salcall.cxx b/compilerplugins/clang/salcall.cxx
index 3c91e76b870a..e70e6477f2b0 100644
--- a/compilerplugins/clang/salcall.cxx
+++ b/compilerplugins/clang/salcall.cxx
@@ -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())
{