Closed
Description
Affected rules
DCL51-CPP
Description
gcc generates a _FUN
static member function when handling lambdas that are converted to function pointers:
This function is incorrectly flagged as a "user written" function with a compiler reserved prefix.
We should update the query to exclude Function
s and Variable
s which are compiler generated.
Example
void g(int (*l)(int)) {}
void test_lambda(const int y) {
// Lambda generates a static function called `_FUN` when the lambda is
// converted to a function pointer
g([](int x) { return x; }); // COMPLIANT[FALSE_POSITIVE] - compiler generated
}