This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11880] [regression] implicit template instantiation instantiate unused class methods
- From: "casteyde dot christian at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Aug 2003 21:21:31 -0000
- Subject: [Bug c++/11880] [regression] implicit template instantiation instantiate unused class methods
- References: <20030811101922.11880.casteyde.christian@free.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.