Skip to content

Commit 94a7d9d

Browse files
authored
fix local variable will be copied despite being returned by name (#8157)
this is an error with clang 7 note: call 'std::move' explicitly to avoid copying
1 parent b80c95c commit 94a7d9d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

external/o2/src/o2replyserver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ QMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data) {
105105
QString value = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.second.trimmed().toLatin1()));
106106
queryParams.insert(key, value);
107107
}
108-
return queryParams;
108+
return std::move( queryParams );
109109
}
110110

111111
void O2ReplyServer::closeServer(QTcpSocket *socket, bool hasparameters)

src/plugins/grass/qtermwidget/ColorScheme.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <QtDebug>
3434
#include <QSettings>
3535
#include <QDir>
36+
#include <QStringList>
3637

3738

3839
// KDE
@@ -698,7 +699,7 @@ QList<QString> ColorSchemeManager::listKDE3ColorSchemes()
698699
QStringList ret;
699700
foreach ( QString i, list )
700701
ret << dname + "/" + i;
701-
return ret;
702+
return std::move( ret );
702703
//return KGlobal::dirs()->findAllResources("data",
703704
// "konsole/*.schema",
704705
// KStandardDirs::NoDuplicates);
@@ -715,7 +716,7 @@ QList<QString> ColorSchemeManager::listColorSchemes()
715716
QStringList ret;
716717
foreach ( QString i, list )
717718
ret << dname + "/" + i;
718-
return ret;
719+
return std::move( ret );
719720
// return KGlobal::dirs()->findAllResources("data",
720721
// "konsole/*.colorscheme",
721722
// KStandardDirs::NoDuplicates);

0 commit comments

Comments
 (0)