Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Consider -Wshadow-member subgroup for derived members shadowing base members #13952

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR13875
Status CONFIRMED
Importance P enhancement
Reported by David Blaikie (dblaikie@gmail.com)
Reported on 2012-09-19 12:29:43 -0700
Last modified on 2018-11-13 18:42:58 -0800
Version trunk
Hardware PC Linux
CC dgregor@apple.com, llvm-bugs@lists.llvm.org, trass3r@gmail.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
struct base { int i; };
struct derived: base { int i; };

We should see about warning on derived's 'i' under a subgroup of -Wshadow
(possibly -Wshadow-member - suggestions welcome).
Quuxplusone commented 11 years ago

This could/should also include shadowed member functions as well as member variables. (with a possible suggestion that the member function be marked virtual in the base and, in C++11, override in the derived class)

Quuxplusone commented 5 years ago

statics as well: https://godbolt.org/z/jL0ony