Closed
Description
Affected rules
A5-1-1
Description
This query is producing false positives because we are flagging legitimate logging or print calls. We should add support for the following:
- Use of
std::ostream
and other supported function in a variable template - see the example below. - Exclude results expanded from a logging macro (based on the name of the macro)
Optional extension:
- Ensure we capture wrappers around logging functions (i.e. functions that pass arguments only a logger or printf call should be consider, themselves, logger calls).
Example
template <typename T>
void PrintFoo(std::ostream& os, const T& bar, const char* str) noexcept {
const Foo& foo{GetFoo(bar)};
os << str << "blah blah" << foo << "blah blah" << bar.baz << ".";
}