We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1585cde commit 2db790aCopy full SHA for 2db790a
flang/lib/Semantics/check-omp-structure.cpp
@@ -270,8 +270,10 @@ void OmpStructureChecker::CheckDirectiveSpelling(
270
// with spaces removed).
271
auto removeSpaces = [](llvm::StringRef s) {
272
std::string n{s.str()};
273
- for (auto it{n.begin()}; it != n.end();) {
274
- it = isspace(*it) ? n.erase(it) : std::next(it);
+ for (size_t idx{n.size()}; idx > 0; --idx) {
+ if (isspace(n[idx - 1])) {
275
+ n.erase(idx - 1, 1);
276
+ }
277
}
278
return n;
279
};
0 commit comments