This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: wrong warning on private constructors
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: gcc at gcc dot gnu dot org, <gdr at integrable-solutions dot net>, Stefan Seefeld <stefan dot seefeld at orthosoft dot ca>
- Date: Tue, 17 Dec 2002 15:15:37 -0600 (CST)
- Subject: Re: wrong warning on private constructors
> | Is there a way to disable this warning? Or better even, could this
> | warning be dropped ?
>
> I think the logic used in the implementation is broken.
Right. I find the warning equally unuseful, in particular since it warns
about something that you will notice anyway. Warnings should warn about
things that will go wrong when a variable/function/class is used and there
is a risk that the user might not notice. But in this case the warning
warns you when you don't even attempt to use the class, and when you use
it you get the warning _plus_ the errors about private constructors etc.
The only situation I can imagine where this is useful is that some library
author writes a public class and never even tries to instantiate it in his
own library, program, or testcases. This should be a case that is rare
enough not to warrant this warning.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth