This patch avoids the -Wshadow warning for parameters that shadow fields of their enclosing record and that are defined in a setter-like method. The following heuristic is used to avoid the warning:
- If a parameter is used only for assignments like this->x = x;, then the warning can be avoided.
- Otherwise (even if the parameter is unused completely) the warning is shown as normally.
The old behaviour is preserved with -Wshadow-all.