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 7ecd4c4 commit 35eedcaCopy full SHA for 35eedca
lib/checkstl.cpp
@@ -2082,7 +2082,7 @@ void CheckStl::string_c_str()
2082
const Token* strm = tok;
2083
while (Token::simpleMatch(strm, "<<"))
2084
strm = strm->astOperand1();
2085
- if (strm && strm->variable() && strm->variable()->isStlType())
+ if (strm && ((strm->variable() && strm->variable()->isStlType()) || Token::Match(strm->tokAt(-1), "std :: cout|cerr")))
2086
string_c_strStream(tok);
2087
}
2088
0 commit comments