This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]