This is the mail archive of the gcc-bugs@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]

[Bug c++/11880] [regression] implicit template instantiation instantiate unused class methods


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.


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