Skip to content

Commit 35eedca

Browse files
Update checkstl.cpp
1 parent 7ecd4c4 commit 35eedca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/checkstl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ void CheckStl::string_c_str()
20822082
const Token* strm = tok;
20832083
while (Token::simpleMatch(strm, "<<"))
20842084
strm = strm->astOperand1();
2085-
if (strm && strm->variable() && strm->variable()->isStlType())
2085+
if (strm && ((strm->variable() && strm->variable()->isStlType()) || Token::Match(strm->tokAt(-1), "std :: cout|cerr")))
20862086
string_c_strStream(tok);
20872087
}
20882088
}

0 commit comments

Comments
 (0)