> So you're left with things that might be correct, but probably aren't.
C++ is naturally quite context-dependent. And shadowing in it is quite useful -- you don't need to come up with some crazy variable names just because all the saner ones are already used. I shadow stuff all the time and it never really backfired. And I do enjoy nice, concise, context-dependent names. So I don't share the "probably aren't" part.
Posted Jan 25, 2010 10:34 UTC (Mon) by epa (subscriber, #39769)
[Link]
I guess the tool could give you a warning for the unintentional cases, and when you really do want to shadow a class member you can flag it with some new keyword or magic comment:
int x; /* shadow */
LCA: Static analysis with GCC plugins
Posted Feb 4, 2010 12:09 UTC (Thu) by adobriyan (guest, #30858)
[Link]