This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
wrong warning on private constructors
- From: Stefan Seefeld <stefan dot seefeld at orthosoft dot ca>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 17 Dec 2002 16:54:31 -0500
- Subject: wrong warning on private constructors
Hi there,
Gcc emits a warning about objects containing only private
constructors/destructors. Here is the comment from gcc code:
gcc/cp/class.c:
/* Even if some of the member functions are non-private, the class
won't be useful for much if all the constructors or destructors
are private: such an object can never be created or destroyed. */
This argument is invalid because the object can also be
constructed/destructed by other means such as public methods of the same
object (singleton, reference counting, ...).
Is there a way to disable this warning? Or better even, could this
warning be dropped ?
Regards,
Stefan