[flang-commits] [flang] f95bdff - [flang] Suppress a warning in D118631 [-Wunused-result]
Shao-Ce SUN via flang-commits
flang-commits at lists.llvm.org
Tue Jan 31 08:30:18 PST 2023
Author: Shao-Ce SUN
Date: 2023-02-01T00:30:10+08:00
New Revision: f95bdff17b3ed73f7f50479aaab3dfedfe73c9d1
URL: https://github.com/llvm/llvm-project/commit/f95bdff17b3ed73f7f50479aaab3dfedfe73c9d1
DIFF: https://github.com/llvm/llvm-project/commit/f95bdff17b3ed73f7f50479aaab3dfedfe73c9d1.diff
LOG: [flang] Suppress a warning in D118631 [-Wunused-result]
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D142965
Added:
Modified:
flang/lib/Semantics/mod-file.cpp
Removed:
################################################################################
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp
index 5a4aeef806f0..22633054f0ca 100644
--- a/flang/lib/Semantics/mod-file.cpp
+++ b/flang/lib/Semantics/mod-file.cpp
@@ -963,8 +963,10 @@ Scope *ModFileReader::Read(const SourceName &name,
// directory lists, the intrinsic module directory takes precedence.
options.searchDirectories = context_.searchDirectories();
for (const auto &dir : context_.intrinsicModuleDirectories()) {
- std::remove(options.searchDirectories.begin(),
- options.searchDirectories.end(), dir);
+ options.searchDirectories.erase(
+ std::remove(options.searchDirectories.begin(),
+ options.searchDirectories.end(), dir),
+ options.searchDirectories.end());
}
options.searchDirectories.insert(options.searchDirectories.begin(), "."s);
}
More information about the flang-commits
mailing list