wrong warning on private constructors

Wolfgang Bangerth bangerth@ticam.utexas.edu
Tue Dec 17 13:42:00 GMT 2002


> | 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




More information about the Gcc mailing list