[llvm] dfd0cd1 - [GlobPattern] Fix build error on gcc7.5
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 12 16:56:32 PDT 2023
Author: Ellis Hoag
Date: 2023-09-12T16:51:58-07:00
New Revision: dfd0cd1cc182789d351953d2c40b8ccd9fdec34f
URL: https://github.com/llvm/llvm-project/commit/dfd0cd1cc182789d351953d2c40b8ccd9fdec34f
DIFF: https://github.com/llvm/llvm-project/commit/dfd0cd1cc182789d351953d2c40b8ccd9fdec34f.diff
LOG: [GlobPattern] Fix build error on gcc7.5
This fixes a build error introduced by https://reviews.llvm.org/D153587
when using an old version of GCC. See
https://reviews.llvm.org/D153587#4644735 for details.
Added:
Modified:
llvm/lib/Support/GlobPattern.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/GlobPattern.cpp b/llvm/lib/Support/GlobPattern.cpp
index 9813ed2d7a14252..7004adf461a0cc6 100644
--- a/llvm/lib/Support/GlobPattern.cpp
+++ b/llvm/lib/Support/GlobPattern.cpp
@@ -59,7 +59,7 @@ static Expected<SmallVector<std::string, 1>>
parseBraceExpansions(StringRef S, std::optional<size_t> MaxSubPatterns) {
SmallVector<std::string> SubPatterns = {S.str()};
if (!MaxSubPatterns || !S.contains('{'))
- return SubPatterns;
+ return std::move(SubPatterns);
struct BraceExpansion {
size_t Start;
@@ -129,7 +129,7 @@ parseBraceExpansions(StringRef S, std::optional<size_t> MaxSubPatterns) {
for (StringRef Orig : OrigSubPatterns)
SubPatterns.emplace_back(Orig).replace(BE.Start, BE.Length, Term);
}
- return SubPatterns;
+ return std::move(SubPatterns);
}
Expected<GlobPattern>
More information about the llvm-commits
mailing list