build: Enable -Wshadow
This is an attempt to demonstrate what is necessary to get -Wshadow building under -Werror on clang, and to see what other existing pull requests that might conflict with.
This was prompted by an example of shadowing I spotted in review. We currently warn against shadowing in the docs but do not detect it, so instead rely on review to identify these issues.
Note:
- This was previously enabled in 2016 and reverted six months later.
- I proposed a version in 2019 using a different approach in a different context.
The question is: have the circumstances changed in the past 9 years? Is a partial fix beneficial?
One option would be to merge the low-risk changes, re. tests, etc. and exclude sensitive files from this warning to get it applied to regular builds.
Related: