Skip to content

Commit b6ea04a

Browse files
authored
[flang][NFC] Fix build-time warning (#149549)
Don't increment the LHS variable of an assignment that also uses that variable on the RHS.
1 parent 9e5b2fb commit b6ea04a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

flang/lib/Semantics/resolve-labels.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,9 @@ class ParseTreeAnalyzer {
492492
// Uppercase the name of the main program, so that its symbol name
493493
// would be unique from similarly named non-main-program symbols.
494494
auto upperCaseCharBlock = [](const parser::CharBlock &cb) {
495-
char *ch{const_cast<char *>(cb.begin())};
496-
char *endCh{ch + cb.size()};
497-
while (ch != endCh) {
498-
*ch++ = parser::ToUpperCaseLetter(*ch);
495+
auto ch{const_cast<char *>(cb.begin())};
496+
for (char *endCh{ch + cb.size()}; ch != endCh; ++ch) {
497+
*ch = parser::ToUpperCaseLetter(*ch);
499498
}
500499
};
501500
const parser::CharBlock *progName{nullptr};

0 commit comments

Comments
 (0)