This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33878] Pure virtual method body omitted from template
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2008 19:54:15 -0000
- Subject: [Bug c++/33878] Pure virtual method body omitted from template
- References: <bug-33878-15256@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from bangerth at dealii dot org 2008-03-31 19:54 -------
(In reply to comment #0)
> The following stripped down code shows pure virtual method definitions for both
> a normal base class and a templated base class. To my surprise, the templated
> class' body is not generated,
Your example code contains neither a call to TBase<int>::pvMethod (which would
trigger an implicit instantiation of this function from its template) nor an
explicit instantiation of either the entire class or of this function.
Consequently, the compiler doesn't instantiate your template.
If you intend to call TBase<int>::pvMethod from somewhere where the definition
of this template is not visible, you need to add an explicit instantiation of
this function for 'int' as the template arg.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33878