Enhance -Wshadow to emit a warning when typedefs or type aliases are shadowed, or when it shadows a variable.
Bug:
Differential D31235
Enhance -Wshadow to warn when shadowing typedefs or type aliases ahmedasadi on Mar 22 2017, 12:55 AM. Authored by
Details
Enhance -Wshadow to emit a warning when typedefs or type aliases are shadowed, or when it shadows a variable. Bug:
Diff Detail
Event Timeline
Comment Actions Looks good to me
Comment Actions Thanks for reviewing. Would you be able to commit this patch for me, as I do not have commit access? Comment Actions This started making the libc++ bots fail, and I'm not convinced the case is reasonable to warn on. That case is: struct path { using value_type = char; struct iterator { using value_type = path; }; }; Obviously both typedefs are necessary, and according to the standard they are both required to have the same name. I would prefer not to have to #pragma disable this diagnostic within <filesystem> Comment Actions Updated diff to address Eric's comment - it's best not to issue a warning if the shadowing declaration is part of a class (this is what GCC currently does). I will need someone to commit this new patch for me. Comment Actions Comitted follow-up diff 94007 as rL299522: Don't issue a warning if the shadowing declaration is in a class now. |
You don't need to use {} braces here.