This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Your monthly ICE report
- To: carlo at runaway dot xs4all dot nl
- Subject: Re: Your monthly ICE report
- From: Klaus-Georg Adams <Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de>
- Date: Mon, 23 Nov 1998 14:25:42 +0100
- Cc: egcs-bugs at cygnus dot com
Hi Carlo,
if your real problem is this:
// This should be called as copy constructor, right???
template<class Y>
lockable_auto_ptr(const lockable_auto_ptr<Y> &) {
cerr << "Called template<class Y> lockable_auto_ptr(const lockable_auto_ptr<Y> &)" << endl;
}
template<class Y>
lockable_auto_ptr& operator=(const lockable_auto_ptr<Y> &) {
cerr << "Called template<class Y> lockable_auto_ptr& operator=(const lockable_auto_ptr<Y> &)" << endl;
return *this;
}
then your code is broken: [class.copy], clause 3:
...A member function template is never instantiated to perform the
copy of a class object to an object of its class type.
and clause 9: A user-declared copy assignment operator X::operator= is
a non-static non-template member function of class X ...
This means you use the implicitely defined Copyctor, which is a Bad
Thing for auto_ptr :-)
-- 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
-------------------------------------------------------------------------