[cfe-commits] Clang change to detect and warn about unused private members

Daniel Jasper djasper at google.com
Wed Jan 11 01:11:39 PST 2012


the attached change is designed to detect and warn about private unused
members of C++ classes. It checks whether a class is fully defined in the
current translation unit, i.e. all methods are either defined or pure
virtual and all friends are defined. Otherwise, the private member could be
used by a function defined in another translation unit.

An initializer does not count as "use", if:
- the member is a primitive type
- the member is a pointer
- the initializer does not take any arguments

Kind regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120111/e308c9b0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unused-private-members.patch
Type: text/x-patch
Size: 8022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120111/e308c9b0/attachment.bin>

More information about the cfe-commits mailing list