aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-05-20 18:34:32 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-05-20 22:40:26 +0200
commit95ece56efa0b2a3b480ee3a5761d85b348c01377 (patch)
treea58b885499c71b7450484e3f686a74479f5d201c /tools/qmllint
parent36ac9ab322d00ad8a2139bcf463275e3121bfb1f (diff)
Fix Clang 10 warning about creating copies in range-for
We should not copy the loop variables. Fixes: QTBUG-83989 Pick-to: 5.15 Change-Id: Ic94710a2c08aa19656c5e1853c40b10b203bca0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tools/qmllint')
-rw-r--r--tools/qmllint/checkidentifiers.cpp4
-rw-r--r--tools/qmllint/findwarnings.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp
index 619fe8e4b9..0bd5c8127e 100644
--- a/tools/qmllint/checkidentifiers.cpp
+++ b/tools/qmllint/checkidentifiers.cpp
@@ -171,8 +171,8 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<ScopeTree::FieldMember> &
if (scopeMethodIt != methods.end())
return true; // Access to property of JS function
- const auto enums= scope->enums();
- for (const auto enumerator : enums) {
+ const auto enums = scope->enums();
+ for (const auto &enumerator : enums) {
for (const QString &key : enumerator.keys()) {
if (access.m_name == key) {
detectedRestrictiveKind = QLatin1String("enum");
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp
index b177c5f5c4..797b312d92 100644
--- a/tools/qmllint/findwarnings.cpp
+++ b/tools/qmllint/findwarnings.cpp
@@ -394,7 +394,7 @@ void FindWarningVisitor::importExportedNames(const QStringRef &prefix, QString n
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());
}