Question on explicit template expansion

Nathan Sidwell nathan@codesourcery.com
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
	#ifndef __EXPAND_LIBRARY_FOR_COMPILE__
	template <> myclass<char>::myclass();
	template <> myclass<char>::~myclass();
	template <> void myclass<char>::method();
	#endif
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

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



More information about the Gcc-help mailing list