PATCH: Testcase for new C++ bug? Comments please.

Klaus-Georg Adams Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Fri Jul 3 08:38:00 GMT 1998


>>>>> "Martin" == Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:

    >> But what if you want to see that warning for other objects?
    Martin> Just compile a single file with this flag.

This won't help you, because the warning is given in every file which
#include's the interface of the singleton (and you would have to chase
them all in the Makefile). Not a realistic option. If you have a
single header which causes this warning, you have to turn it off for
the entire compilation.

It is not a #pragma that is needed (although it would help to kludge
around the problem), but the warning has to be fixed.  It makes sense
to warn about a class that is completely inaccesible. But this is not
the case here.

Note: I don't know the internals of gcc, but if it can check for
private ctor and dtors, it could just as well check for static public
functions returning an object of the offending class.

-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams        Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II            Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------



More information about the Gcc mailing list