[Bug c++/11880] [regression] implicit template instantiation instantiate unused class methods
casteyde dot christian at free dot fr
gcc-bugzilla@gcc.gnu.org
Mon Aug 11 21:21:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11880
------- Additional Comments From casteyde dot christian at free dot fr 2003-08-11 21:21 -------
I do not agree. B::B() doesn't need ptr::~ptr,
in any case. If ptr::ptr was to throw an exception,
ptr::~ptr shouldn't be called since the ptr object
wouldn't have been fully constructed.
The only thing that could happen would be a call
to operator delete if this was dynamically called
(which is not the case here). The compiler should
pass the exception to the code that builds the B.
Therefore, ptr::~ptr is not necessary at all in
such a context.
Moreover, the default constructor should have
the same requirements, and this is not
the case (at least I could accept this bug
requalification to "default constructor doesn't
instantiate template members' destructor"!!).
You can easily see it by commenting out the
"B::B() {}" line in the given code.
More information about the Gcc-bugs
mailing list