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

Manuel Klimek klimek at google.com
Sat Mar 17 02:05:37 PDT 2012

On Sat, Mar 17, 2012 at 8:30 AM, Douglas Gregor <dgregor at apple.com> wrote:
> Templates are an interesting case, because it's actually quite unlikely that we'll ever see the definition of all of the member functions of a class template, since no translation unit is likely to instantiate all of them. Perhaps we shouldn't bother even trying to make this warning work for templates?

That is an interesting expectation. And if people only used templates
for base libraries, I would agree. In the large code base I happen to
work in there are many templates for which I would expect all
functions to be instantiated in a translation unit. Templates used for
performance reasons, templates used for "strategy pattern" styles etc.

I agree with the idea of not trying to make this warning work for them
unless we find a way to handle specializations, though.


More information about the cfe-commits mailing list