https://bugs.llvm.org/show_bug.cgi?id=31222
Aaron Ballman <aa...@aaronballman.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from Aaron Ballman <aa...@aaronballman.com> ---
Clang currently supports -Wshadow-field to catch exactly this situation. It's
not enabled by -Wshadow because this diagnostic has a fair number of "false"
positives that users aren't always interested in dealing with. Consider this
case:
struct S {
int x, y;
};
struct D : S {
int z;
int f() {
return z;
}
};
Everything is great -- there's no shadowing. Sometime later, a developer goes
and changes the definition of S to:
struct S {
int x, y, z;
};
This creates a shadow within D, but it didn't actually break anything either.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs