diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 14:46:06 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 13:47:53 +0000 |
commit | 8eb4d52342fe3a6ede1c1dce3174d95bfa0cea88 (patch) | |
tree | 0f5556c5e4098e75853e3d9ee2620e0306f0cf2a /src/plugins/projectexplorer/gcctoolchain.cpp | |
parent | 90de29d530dfc2921d5179977b3393c11a3cc238 (diff) | |
download | qt-creator-8eb4d52342fe3a6ede1c1dce3174d95bfa0cea88.tar.gz |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/gcctoolchain.cpp')
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 0b2b37fbcf..e4581419fa 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -627,7 +627,7 @@ HeaderPaths GccToolChain::builtInHeaderPaths(const Utils::Environment &env, headerCache->insert({env, arguments}, paths); qCDebug(gccLog) << "Reporting header paths to code model:"; - for (const HeaderPath &hp : qAsConst(paths)) { + for (const HeaderPath &hp : std::as_const(paths)) { qCDebug(gccLog) << compilerCommand.toUserOutput() << (languageId == Constants::CXX_LANGUAGE_ID ? ": C++ [" : ": C [") << arguments.join(", ") << "]" << hp.path; @@ -1108,7 +1108,7 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, FilePaths searchPaths = detector.searchPaths; if (searchPaths.isEmpty()) searchPaths = device->systemEnvironment().path(); - for (const FilePath &deviceDir : qAsConst(searchPaths)) { + for (const FilePath &deviceDir : std::as_const(searchPaths)) { static const QRegularExpression regexp(binaryRegexp); const auto callBack = [&compilerPaths, compilerName](const FilePath &candidate) { if (candidate.fileName() == compilerName) @@ -1142,7 +1142,7 @@ static FilePaths findCompilerCandidates(const ToolchainDetector &detector, searchPaths << ccachePath; } } - for (const FilePath &dir : qAsConst(searchPaths)) { + for (const FilePath &dir : std::as_const(searchPaths)) { static const QRegularExpression regexp(binaryRegexp); QDir binDir(dir.toString()); const QStringList fileNames = binDir.entryList(nameFilters, @@ -1173,7 +1173,7 @@ Toolchains GccToolChainFactory::autoDetectToolchains( Toolchains existingCandidates = filtered(detector.alreadyKnown, [language](const ToolChain *tc) { return tc->language() == language; }); Toolchains result; - for (const FilePath &compilerPath : qAsConst(compilerPaths)) { + for (const FilePath &compilerPath : std::as_const(compilerPaths)) { bool alreadyExists = false; for (ToolChain * const existingTc : existingCandidates) { // We have a match if the existing toolchain ultimately refers to the same file |