singleton idiom evokes a warning, an error.
Klaus-Georg Adams
Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Tue Dec 8 02:02:00 GMT 1998
Michael Cook (cook@clearviewtech.com) wrote:
> class x
> {
> x();
> ~x(); //4
> public: static x& only();
> }; //6
>
> x& x::only()
> {
> static x t; //10
> return t;
> }
>
> /*
> $ egcs -v
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
> $ egcs -c -Wall blue.cpp -o /dev/null
> blue.cpp:6: warning: `class x' only defines a private destructor and has no friends
> blue.cpp: In function `void __tcf_0()':
> blue.cpp:4: `x::~x()' is private
> blue.cpp:10: within this context
> $
> */
Hi Martin,
thank you for your bug report. These two bugs have been fixed in the
main branch of egcs. Unfortunately I think they are still present in
the egcs-1.1.1 release.
-- 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-bugs
mailing list