aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-20 18:34:32 +0200
committerThiago Macieira <thiago.macieira@intel.com>2020-05-25 01:22:13 -0700
commitbf601b4ab1b4942fe6f34d87d290455a321402fa (patch)
tree2052603de4d8bc0c131faa75cedfbcaa51c1e75a /tools
parente7fbcfef757bd4805c2f3d6241ed5e62ff60ab73 (diff)
Fix Clang 10 warning about creating copies in range-for
We should not copy the loop variables. Fixes: QTBUG-83989 Change-Id: Ic94710a2c08aa19656c5e1853c40b10b203bca0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 95ece56efa0b2a3b480ee3a5761d85b348c01377) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmllint/findunqualified.cpp2
-rw-r--r--tools/qmllint/scopetree.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/qmllint/findunqualified.cpp b/tools/qmllint/findunqualified.cpp
index 4252cda9d6..8a216fe748 100644
--- a/tools/qmllint/findunqualified.cpp
+++ b/tools/qmllint/findunqualified.cpp
@@ -386,7 +386,7 @@ void FindUnqualifiedIDVisitor::importExportedNames(const QStringRef &prefix, QSt
if (scope) {
if (scopes.contains(scope)) {
QString inheritenceCycle = name;
- for (const auto seen: qAsConst(scopes)) {
+ for (const auto &seen: qAsConst(scopes)) {
inheritenceCycle.append(QLatin1String(" -> "));
inheritenceCycle.append(seen->superclassName());
}
diff --git a/tools/qmllint/scopetree.cpp b/tools/qmllint/scopetree.cpp
index c47dac3df5..7eda6aab97 100644
--- a/tools/qmllint/scopetree.cpp
+++ b/tools/qmllint/scopetree.cpp
@@ -209,7 +209,7 @@ bool ScopeTree::checkMemberAccess(
if (scopeMethodIt != scope->m_methods.end())
return true; // Access to property of JS function
- for (const auto enumerator : scope->m_enums) {
+ for (const auto &enumerator : scope->m_enums) {
for (const QString &key : enumerator.keys()) {
if (access->m_name != key)
continue;