__func__ or __FUNCTION__ is used inside a lambda, where it names the lambda's call operator and not the enclosing function

tx0/cpp:function-name-in-lambdarecommendedwarningreliability/logicdepth fastbug

What it finds

Inside a lambda, __func__ is the name of the lambda's operator(), usually printed as operator(), so a log message or assertion text loses the function it came from. The name is captured from outside the lambda instead.

From the rule's source, function_name_in_lambda.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:function-name-in-lambda" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:function-name-in-lambda] reason="..."

tx0 explain tx0/cpp:function-name-in-lambda shows the same in the terminal. Found a false positive? Report it.