Question on explicit template expansion

Nathan Sidwell
Tue May 17 15:26:00 GMT 2005

Garrett Kajmowicz wrote:

> The attached test case comes with a Makefile.  Type make and watch the warning 
> message occur.  Note that the warning messages occur only for the constructor 
> and destructor, and not for the other method.

header.h contains
	template <> myclass<char>::myclass();
	template <> myclass<char>::~myclass();
	template <> void myclass<char>::method();
these *declare* specializations of the myclass ctor,dtor and method.  There's
no reason to make them NOT visible when compiling the library.

However, it does appear to be a g++ bug in that the inline attribute is
copied from the general template to the specialization.


Nathan Sidwell    ::   ::     CodeSourcery LLC    ::

More information about the Gcc-help mailing list