As part of compliance for our Checked C LLVM compiler, we at Microsoft ran the PREfast static analysis tool on the entire llvm/clang codebase. The tool reported hundreds of warnings due to variables being shadowed.For example:
clang/lib/Sema/TreeTransform.h(3709) Local declaration of ‘I’ hides declaration of the same name in outer scope. See previous declaration at line ‘3653’.
We can upstream fixes to these (and other) warnings if the community would like them fixed. The full list of warnings can be found here.
Also, is there a reason we do not turn on the -Wshadow flag by default for llvm builds?