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

casteyde dot christian at free dot fr gcc-bugzilla@gcc.gnu.org
Tue Aug 12 06:49: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-12 06:49 -------
Right. I hadn't understood that the exception was raised by B::B().
Actually, B as B isn't a try constructor, we can tell the compiler
there is no exception at stake here explicitely by the following
declaration:

B() throw() {}

Then the ~ptr() is no more used by GCC, and the code compiles.
I think this is exactly what the default constructor does.

Well, it wasn't really simple, but the code sample was
effectively not valid (btw, OpenSP had been patched
in sourceforge to bypass the problem, even if it wasn't
well understood). It's not a compiler bug, GCC is right
here (and I'm rather impressed).

Thanks



More information about the Gcc-bugs mailing list