This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26621] template Instanciation fails for -O1 -finline-functions
- From: "_talyn_ at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2006 18:06:36 -0000
- Subject: [Bug c++/26621] template Instanciation fails for -O1 -finline-functions
- References: <bug-26621-12333@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from _talyn_ at web dot de 2006-03-09 18:06 -------
Allocating the CVectorWrap variable dynamically removes the undefined reference
to TTypeWrapper::~TTypeWrapper. I guess that's because it is virtual, and a
dynamic instance of CVectorWrap will call CVectorWrap::~CVectorWrap via VMT.
But this would mean that a copy of TTypeWrapper::~TTypeWrapper is somehow
available, just not accessable outside instance.cc.
And there are the other link errors: get_type() and get<T>() are refereced in
instance.cc. I guess they are inlined therein, and hence, referencing these
functions from wrap_filter fails.
(In reply to comment #2)
> I don't think this is a bug. We are inlining CVectorWrap::~CVectorWrap into
> main which causes the reference to TTypeWrapper::~TTypeWrapper and
> TTypeWrapper::~TTypeWrapper is not used in instance.cc at all so it is not
> emitted.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26621