File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -549,6 +549,8 @@ void CheckIO::checkWrongfeofUsage()
549549 bodyEnd = tok->previous ();
550550 bodyStart = bodyEnd->link ();
551551 } else {
552+ if (!Token::simpleMatch (endCond, " ) {" ))
553+ continue ;
552554 bodyEnd = endCond->linkAt (1 );
553555 bodyStart = endCond->next ();
554556 }
@@ -614,8 +616,8 @@ void CheckIO::checkWrongfeofUsage()
614616 }
615617
616618 // Search for any destination use between this call's ';' and endBody
617- const Token *SemiColonTok = lastLoopFileReadCallTok->linkAt (1 )->next ();
618- for (const Token *t = SemiColonTok ; t && t != bodyEnd; t = t->next ()) {
619+ const Token *semiColonTok = lastLoopFileReadCallTok->linkAt (1 )->next ();
620+ for (const Token *t = semiColonTok ; t && t != bodyEnd; t = t->next ()) {
619621 if (std::find (destVarIds.begin (), destVarIds.end (), t->varId ()) != destVarIds.end ()) {
620622 wrongfeofUsage (getCondTok (tok));
621623 break ;
You can’t perform that action at this time.
0 commit comments